RegExpression help....

Posted by Gore on Sun 08 Feb 2004 11:06 PM — 3 posts, 13,997 views.

#0
Hello, I'm trying to trigger these phrases,,

Quote:

"rat200385" the corpse of an old rat
"rat205891" the corpse of a rat
"rat201877" the corpse of a baby rat


I need the rat#, and anything after of doesn't matter, so far I've got this for a reg expression pattern


^\"*\"\sthe corpse of*$


But it doesn't work, any ideas?

USA #1
^\"(.*)\" the corpse of.*$

() is needed to tell it to actually return the number. Otherwise is just matches the text, but does not produce a wild card. If you also need the name then add () around the last '.*' as well. As for the '.*' itself, regexp in mushclient uses the Perl standard, so * means only 'look for one or more of these'. The '.' is actually the part that means 'any character'. So to get more than one of any possible character you need '.*'. ;)
#2
Way to rock Shadow >:) Thanks again.