Re: regex variable matching when it's more than variable

2008-04-20 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: say I have my $var1 = 'abcdefg'; my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits (only first one should quailfy

Re: regex variable matching when it's more than variable

2008-04-20 Thread Rob Dixon
Richard Lee wrote: > say I have > > my $var1 = 'abcdefg'; > > my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); > > Let's say I want to go through the array to see if $var1 exists and also > to see if it followed by _ and then 4 digits (only first one should > quailfy , abc

Re: regex variable matching when it's more than variable

2008-04-20 Thread Dr.Ruud
Richard Lee schreef: > my $var1 = 'abcdefg'; > > my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); > > Let's say I want to go through the array to see if $var1 exists and > also to see if it followed by _ and then 4 digits (only first one > should quailfy , abcdefg_3432 )

Re: regex variable matching when it's more than variable

2008-04-20 Thread Dr.Ruud
Richard Lee schreef: > my $var1 = 'abcdefg'; > > my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); > > Let's say I want to go through the array to see if $var1 exists and > also to see if it followed by _ and then 4 digits (only first one > should quailfy , abcdefg_3432 ) >

Re: regex variable matching when it's more than variable

2008-04-20 Thread Aruna Goke
Richard Lee wrote: say I have my $var1 = 'abcdefg'; my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits (only first one should quailfy , abcdefg_3432 ) I

Re: regex variable matching when it's more than variable

2008-04-20 Thread John W. Krahn
Richard Lee wrote: say I have my $var1 = 'abcdefg'; my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits (only first one should quailfy , abcdefg_3432 ) I

regex variable matching when it's more than variable

2008-04-20 Thread Richard Lee
say I have my $var1 = 'abcdefg'; my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits (only first one should quailfy , abcdefg_3432 ) I tried, for (@array)

Re: Variable matching.....

2004-03-09 Thread John W. Krahn
Silverfox wrote: > > Hi all, Hello, > I'm trying to figure out how can I check if a variable matches the > first 5 digits of the line below without removing anything from the line. > > 13384 R 20020920 N Gatekeeper, The In perl, if a variable looks like a number then perl will treat it as a nu

Re: Variable matching.....

2004-03-09 Thread david
Silverfox wrote: > Hi all, I'm trying to figure out how can I check if a variable matches the > first 5 digits of the line below without removing anything from the line. > > 13384 R 20020920 N Gatekeeper, The if you are only concern about digits in front of the line, you don't even need a regex

Re: Variable matching.....

2004-03-09 Thread WilliamGunther
In a message dated 3/9/2004 3:08:10 PM Eastern Standard Time, [EMAIL PROTECTED] writes: >Careful, I believe we want the above capture anchored to the start of >the line, though I prefer the direct match approach... You're right about the anchor, but direct match wouldn't be the preferable method

Re: Variable matching.....

2004-03-09 Thread Wiggins d Anconia
> In a message dated 3/9/2004 2:43:16 PM Eastern Standard Time, > [EMAIL PROTECTED] writes: > >Hi all, I'm trying to figure out how can I check if a variable matches the > >first 5 digits of the line below without removing anything from the line. > > > >13384 R 20020920 N Gatekeeper, The > > > >

Re: Variable matching.....

2004-03-09 Thread Wiggins d Anconia
> Hi all, I'm trying to figure out how can I check if a variable matches the > first 5 digits of the line below without removing anything from the line. > > 13384 R 20020920 N Gatekeeper, The > > Silver Fox > I'm a bit confused, are you trying to test the line against a variable or a variable

Re: Variable matching.....

2004-03-09 Thread WilliamGunther
In a message dated 3/9/2004 2:43:16 PM Eastern Standard Time, [EMAIL PROTECTED] writes: >Hi all, I'm trying to figure out how can I check if a variable matches the >first 5 digits of the line below without removing anything from the line. > >13384 R 20020920 N Gatekeeper, The > >Silver Fox use

Variable matching.....

2004-03-09 Thread SilverFox
Hi all, I'm trying to figure out how can I check if a variable matches the first 5 digits of the line below without removing anything from the line. 13384 R 20020920 N Gatekeeper, The Silver Fox -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]