in reply to Wildcard?
Simple regexp.. if ($string=~ /^R..$/i) { #bleah }. The i at the end makes it case-insensitive, if you want it case sensitive (ie. matches 'Ray' but not 'ray') then remove it.
Update: Thanks Juerd for the correction below, although realised we're both wrong!
The following will match any three letter string, starting with a 'r' and optionally ending with a newline... if ($string =~ /^R[A-Z][A-Z]\n?$/i) { # bLEEEA }
Again this is case insensitive, to make it sensitive now though you need to change the A-Z bits into which case you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Wildcard?
by Juerd (Abbot) on May 30, 2002 at 12:36 UTC | |
by Molt (Chaplain) on May 30, 2002 at 12:51 UTC | |
by Juerd (Abbot) on May 30, 2002 at 13:32 UTC |