MyBB Community Forums

Full Version: MyBB Showthread Regex
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is valid regex for a MyBB showthread page?

I want to search messages for this text/regex: http://herooftime.net/showhread.php?tid=(any positive integer)

Any regex peeps out there?
search the posts table for that condition or search something else? If MySQL, try this:

SELECT pid, message FROM mybb_posts WHERE message REGEXP '[[:<:]]http://herooftime.net/showhread.php\?tid=[0-9][[:>:]]'

no sure it will work but it does show the function use so you can look it up yourself to see if you can get a better solution. i am not a regex expert by any means.
I want to find all instances of links to showthread while parsing the message.
just find, or also replace it?

Just find, and store the tid and/or pid as regex var things.
you will need to use preg_match or preg_match_all PHP functions. The regex should be something like

'/^http://herooftime.net/showhread.php\?tid=[0-9]/i'