Just another perl hacker somewhere near Disneyland
I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.
I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.
[^\S\n]*. Except that in several places, I had [\S\n]*. Oops (it would have been slightly more obvious if I had also taken more advantage of the 'x'modifier). Solution:my $WS = qr/[^\S\n]*/;
...
my $regex = qr/blah,blah,blah,${WS},blah,blah/;
or perhaps this would be better (or just as well):
my $WS = qr/(?m).*/;
I don't think it does what you think... (Score:1)
my $WS = qr/[^\S\n]*/;
is doing what you think it does. '\S' within a character set doesn't expand to 'all non-space characters', but only means a regular, boring 'S'. E.g.:
$ perl -e'print "See" =~
Re:I don't think your test does what you think... (Score:1)
\Sdoes match all non-whitespace characters, and since your test consists of non-whitespace (including an 'S' which would have matched even if\Sdid what you thought it would do), your regex matches. Leave the "S" out of your test string and it will still match...then set the test string to a single "\t" and it won't matchRe: (Score:1)
*open shell*
*typety-type*
*stare*
*blush*
*sigh*
*put on dunce cap*