MyBB Community Forums

Full Version: Regex for showthread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Been looking around for a while for a good regex that checks for a tid input.

Something like:[0-9]

Help is appreciated,
Still looking for this.
Can you tell me what you want to achieve by checking it ?
I am trying to understand your requirement so i can answer it.
What is wrong with:[0-9]+)

From what I can understand it would get any amount of numbers coming after tid and will stop if there is anything not a number after it, for example:

It would stop at & and get you 200.


If you're using it inside a plugin, you can access $post['tid'] directly if you reference $post, from a postbit.


This is what mybb uses for merging threads, which shows you 2 examples on how to get the URL, split and get the tid from it: