alecks Posted April 4, 2007 Share Posted April 4, 2007 As far as I can tell this is a valid reg. expression: ^/\*.*?\*/$ It's ^/*.*?*/$ without the escaping. Basically its looking for (php) quoted out (using /* and */) sections in a string. But when I try to $tc = "/* This is a Test */ tttttttttttttttttttt /* This is another test */ tttttttttttttrrrrrrrrrr"; $r = preg_split("^/\*.*?\*/$", $tc, -1); I get the warning Warning: preg_split() [function.preg-split]: No ending delimiter '^' found in /path/to/file.php on line # Any help? Quote Link to comment https://forums.phpfreaks.com/topic/45488-regular-expression-ending-delimeter/ Share on other sites More sharing options...
genericnumber1 Posted April 4, 2007 Share Posted April 4, 2007 you have to contain your regex in delimiters... you can use any characters, but it's normally easier to use characters you don't use in your expression, so you could do something like %^/\*.*?\*/$% % being your delimiter.. Quote Link to comment https://forums.phpfreaks.com/topic/45488-regular-expression-ending-delimeter/#findComment-220865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.