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
https://forums.phpfreaks.com/topic/55981-solved-regex-matches-help/
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.