PugSA has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I postes in chatterbox but thought to post a more accurate picture of what I am trying to accomplish Thank you for your time
I am tryning to match in $record CPOSTA_1221170039_C1_F1 but it includes the whole path when it matches
This is what I match => 49\backup\rbgmst02_dd2\stu1\CPOSTA_1221170039_C1_F1
how do I get it not to include the \ and why does it match the \ for interest sake?
I have tried [^\\] but it then just does not match anything
$record = "FRAG 1 1 2000000 0 0 0 0 \\\\172.20.13.49\\backup\\rbgmst02 +_dd2\\stu1\\CPOSTA_1221170039_C1_F1 rbgmst02 65536 0 0 -1 0 *NULL* 12 +22379639 1 65537 0 0 0 0 0 0 0"; if($record =~ m|FRAG|) { if($record =~ m|([A-z0-9]+[_][0-9]+[_]C[0-9]+[_][A-z0-9]+)|) { #print $2."\n"; push(@netbck_list,$1); print $1."\n"; } #if($record =~ m|FRAG(.*?)\/([A-z0-9_-]+[_][0-9]+[_]C[0-9]+[_][A +-z0-9]+)|) else { #print "FRAG RECORD NOT MATCHED => $record \n"; } } #if($record =~ m|FRAG|)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular expression
by johngg (Canon) on Sep 16, 2008 at 14:36 UTC | |
|
Re: Regular expression
by Fletch (Bishop) on Sep 16, 2008 at 13:23 UTC | |
|
Re: Regular expression
by Corion (Patriarch) on Sep 16, 2008 at 13:27 UTC | |
by PugSA (Beadle) on Sep 16, 2008 at 13:38 UTC | |
by shmem (Chancellor) on Sep 16, 2008 at 14:05 UTC | |
|
Re: Regular expression
by pjotrik (Friar) on Sep 16, 2008 at 13:45 UTC | |
|
Re: Regular expression
by Grey Fox (Chaplain) on Sep 16, 2008 at 14:38 UTC |