Hello all.
I need some help. I need a setup trigger/s that's automagically highlight a fur's height. here are some examples of what I've seen.
800 meters, 2000 tall, 2600 feet tall, 80 foot-tall, 180 feet tall, 6 feet, ten ft. six in, 5 feet 10 inches, five feet five inches, 6 ft tall, 2' tall and 6'4"
Any help and examples with be much appreciated THanks all.
Stefan Wulph
Proud Winfur and FADHD
Oh my, what a nightmarish challenge for using Regular Expressions! Before taking a stab at it, could your provide a few examples that show the whole line?
Yes... Real examples would help some. I considered trying to tackle this and stopped when my head exploded. lol But in general it 'should' be possible with enough information.
How about...
Since, I assume, each number would be followed by an appropriate measurement... Most of them have spaces in between, and Im going to assume they have spaces in front of them (if not, Theyre at the beginning of the line, and its just as well), just remove my first space and replace it with a new-line...
I wont go over each individual... Ill just TRY And give a reasonable general explination of how *I* would go about this... Without all the fancy syntax and such, for now.
Heregoes.
Use Reg Exp (obviously),
[ ][A-Za-z0-9]+[ ](inch|inches|foot|feet|meter|meters)(( |-)tall)?
That should match anything that is in text form (all except the ' " notation), Color that, Add in any other Length measurements to the alternatives, and you SHOULD be set... I think. the whole 6 in thing may be a problem, since, "in" is used as a word... If you can give the Reg Exp more specificity (like, if there is a "You see a monster standing [height]" you can match on that...)
As for the other notation...
the ammounts will all be numbers, so
[0-9]+('|")(( |-)tall)?
should do the trick...
Although, If you have someone talking (if your mud quotes using ' or " and they end a line with a number, this too will be highlighted...
However, as has been said already, Specific Examples will help.. a LOT, as we can cue in on other keywords to make your Reg Exps more reliable, and remove the bugs as stated above.