T.G. Cornholio has asked for the wisdom of the Perl Monks concerning the following question:
And here is the output (on a linux box):$_ = ' onn (bbcreccsnnl_output) !OUTPUT'; if ($_ =~ /^S\s+[-]*\d+[\.\d+]*\s+[-]*\d+[\.\d+]*\s*\(\s*IOPUT|OUTPUT\ +s*\)/i) { print "It matches with case insensitive...\n"; } else { print "It does NOT match with case insensitive...\n"; } if ($_ =~ /^S\s+[-]*\d+[\.\d+]*\s+[-]*\d+[\.\d+]*\s*\(\s*IOPUT|OUTPUT\ +s*\)/) { print "It matches without case insensitive...\n"; } else { print "It does NOT match without case insensitive...\n"; }
Your insights are greatly appreciated. This has me baffled (not that this is difficult to achieve or anything).It matches with case insensitive... It does NOT match without case insensitive...
($_ =~ /\(\s*IOPUT|OUTPUT\s*\)/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Incorrect Pattern Matching Behavior
by jonadab (Parson) on Mar 22, 2006 at 02:05 UTC | |
|
Re: Incorrect Pattern Matching Behavior
by McDarren (Abbot) on Mar 22, 2006 at 00:34 UTC | |
by T.G. Cornholio (Scribe) on Mar 22, 2006 at 00:42 UTC | |
by hv (Prior) on Mar 22, 2006 at 02:03 UTC | |
by McDarren (Abbot) on Mar 22, 2006 at 01:59 UTC | |
|
Re: Incorrect Pattern Matching Behavior
by T.G. Cornholio (Scribe) on Mar 22, 2006 at 02:14 UTC |