I've been trying to match some incoming strings from a mud(text based rpg) and I'm having some trouble.
I need a regex that will match the <mob> tag in these strings. You can have a separate regex per sentence to match the surrounding text.
You would stomp <mob> into the ground.
<mob> would be easy, but is it even worth the work out?
No Problem! <mob> is weak compared to you.
<mob> looks a little worried about the idea.
<mob> should be a fair fight!
<mob> snickers nervously.
A chubby porcupine should be a fair fight!
No Problem! A small dark viper is weak compared to you.
An example regex could be '(.*) should be a fair fight!'. But that would match the entire mob tag and not separate them into groups.
<mob> can be a bunch of words separated by spaces.
However, I only want words that are longer than two characters in length.
Also I would like each word stored as a separate group for easy access.
For example, in the cast of "A chubby porcupine", I would only want chubby and porcupine as the result.
I have medium skill with regex; I tried a bunch of things with no success. Best I got was matching one of the words with length greater than two, like porcupine.
Edited 6 Years Ago by shwick: n/a