I am using regex to find: [posts=40]info goes here[/posts]
The regex pattern I'm using: $pattern = "#\[posts=(?:\"|')?(.*?)[\"']?(?:\"|')?\](.*?)\[\/posts\](\r\n?|\n?)#";
This all works find and dandy. But, what I'm trying to accomplish, is: If it is surrounded by code tags I don't want it to match.
For instance:
Code: Select all
something could be here then [posts=40]info goes here[/posts] could be there then I could end the tag The string would look like
Code: Select all
[code] something could be here then [posts=40]info goes here[/posts] could be there then I could end the tag