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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.