$re = '/[\w +*-.\[\]\/\'()#:]+/m';
$str = '2MASSW J0208183+254253
* del Cru
NGC 4964
V* S And
BD-15 6290e
WASP-5b
HD 218396c
* mu. Dra
2MASX J21104545-2308066
4C 11.71
[AKS95] 69
[EAD2001] HDFS J223247.66-603335.9
[DHB2009] TrES-2/C
NAME Barnard\'s Loop
NAME EWS 2007-BLG-349L(AB)c
GEN# +9.04007220
APMUKS (BJ) B004021.02-650219.5
[HS99] NGC 891:D+007-032
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php