in reply to Regular Expression Help!
As described in perlretut (the regular expressions tutorial), you can use the character class \s to test for white space. As well, as long as you don't use the x modifier (for in lining comments), you can just use a space character in your code. In your case, however it's probably easier to test for characters that are not whitespace using \S:
for ("Hello", " ", " x " ) { print /\S/ ? "'$_': Fail\n" : "'$_': Pass\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expression Help!
by Anonymous Monk on Jul 02, 2010 at 19:24 UTC | |
by kennethk (Abbot) on Jul 02, 2010 at 19:34 UTC | |
by ikegami (Patriarch) on Jul 02, 2010 at 19:42 UTC |