RE: question on regex's {}

2001-05-19 Thread Joseph P. Discenza
: I have a string: : $line = "12345.123.129683.129837.7263.128." : It is a string of numbers separated by a dot. : : The regex: : $line =~ s/^(\d+\.)/\1/; : will return the first number followed by a dot ie "12345." : But what I want is to be given an arbrirary number $x and to : extract that

Re: question on regex's {}

2001-05-19 Thread Nick Pomponio
At 06:23 AM 5/19/2001, you wrote: >Hi, > > >> $line = "12345.123.129683.129837.7263.128." > >> $x = 3; > >> $line =~ s/^(\d+\.){$x}/\1/; > >I was expecting $line to be >12345.123.129683. If you want to use the regex approach, there are two points: 1) Even if the regex matched the string you inte

Re: question on regex's {}

2001-05-19 Thread Jaime Teng
Hi, >> $line = "12345.123.129683.129837.7263.128." >> $x = 3; >> $line =~ s/^(\d+\.){$x}/\1/; I was expecting $line to be 12345.123.129683. Jaime ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/per