in reply to Re: Regular Expression - Need HElp..pls
in thread Regular Expression - Need HElp..pls
'\w' allows the non-alpha character '_' (which is considered by Perl to be a "word" character). It also allows for a trailing '\n' in the string (the \n isn't "matched", but it's permitted by '$'). Since I understood the OP's criteria to not permit any sort of space or special character, the solution is to use '\z' instead of '$'.
Update: As pointed out by Roy Johnson, \w also matches numeric digits, so the use of \d is redundant.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regular Expression - Need HElp..pls
by GhodMode (Pilgrim) on Jan 31, 2006 at 18:55 UTC | |
by davido (Cardinal) on Jan 31, 2006 at 23:39 UTC |