Jump to content

regular expression ending delimeter


alecks

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/45488-regular-expression-ending-delimeter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.