2007/5/2, Somu <[EMAIL PROTECTED]>:
Hi, i have a matching problem. I get input from the user as a 3-5
character long string consisting of characters from 'l' to 't', and
the chars are always sorted for example, the user enters: 'lrqo'. It
becomes: 'loqr'. But i have to match the modified string to any of the
following: lmn, lpt, lor, mps, npr, nqt, opq, rst. i'm unable to think
of the regexp. Actually i'm trying to write a Tic Tac Toe..
Hello,
It sounds not so hard.I can think of the most comman regex syntax for it,
if ($modified_str =~ /lmn|lpt|lor|mps|npr|nqt|opq|rst/) {
...
}
or,
$_ = $modified_str;
if (/lmn/ || /lpt/ || /lor/ || /mps/ ||...) {
...
}
Wish I'm right for your purpose.:)
--
Chinese Practical Mod_perl book online
http://home.arcor.de/jeffpang/mod_perl/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/