Jump to content

[SOLVED] Finding any character between /*D and D*/


ro88o

Recommended Posts

Hi,

 

I'm trying to match comment-style blocks of text in a file using preg_match_all(). An example of what I'm trying to match is:

 

/*D any character here including tabs, new lines, spaces etc. D*/

 

Up until now I'd tried "~/\*D[\w\W\s]*D\*/~" but in this situation if there was a second block of text it would match the whole thing i.e /*D test D*/ /*D test2 D*/ would be matched rather than gettin two separate matches.

 

I had a search in the forum but the solutions in other posts concerning comments don't seem to solve my problem. Can anybody tell me the pattern I would need to match these comments?

 

Thanks in advance!

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.