broomnew has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; while (<DATA>){ chomp; # # Incorrect REGEXP - missing closing curly ! # V if (/(&[A-Z0-9\.]+:LU)((\d{1,2};\d{1,2})|(\d{1,2)|LD|LC)?/){ my $lookup = $1; my $type = $2; $type ||= ''; print "1. Lookup: [$lookup]:[$type]:[$_]\n"; } # # Correct REGEXP - notmissing closing curly ! # V if (/(&[A-Z0-9\.]+:LU)((\d{1,2};\d{1,2})|(\d{1,2})|LD|LC)?/){ my $lookup = $1; my $type = $2; $type ||= ''; print "2. Lookup: [$lookup]:[$type]:[$_]\n"; } } __DATA__ &&STOP &&JUMP(&VAR2:LU,NE,SPACES)026 &&JUMP(&VAR2:LU2,NE,SPACES)026 &&JUMP(&VAR2:LU23,NE,SPACES)026 &&JUMP(&VAR2:LU23;24,NE,SPACES)026 &&JUMP(&VAR2:LULD;24,NE,SPACES)026 &&JUMP(&VAR2:LULC;24,NE,SPACES)026 &&JUMP027
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Odd closing brace issue
by derby (Abbot) on Apr 08, 2005 at 18:31 UTC | |
|
Re: Odd closing brace issue
by tlm (Prior) on Apr 08, 2005 at 18:33 UTC |