Jump to content

[SOLVED] Regex matches help


Goose

Recommended Posts

I know there are resources on Google and here on this site for this topic, but I don't know what it is actually called so I don't know what to search for. So hopefully some of you smart people can help me out.

 

I am doing a regular expressions search and I want to find a bbcode like tag. There is only one tag and its opening tag looks like [ail] and its closing tag looks like [/ail]. I want to replace the opening and closing tags and have been doing that easily  with str_replace() but now I need to do more than replace text. I want to grab the text inside the tags with a regular expression.

 

So, how do I match this pattern [ail]inside_text[/ail] and store the inside_text into a variable?

 

Thanks!

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.