in reply to Newbie reg.exp question!
If you really want to use a regexp (which is less efficient), use something like:use strict; my $string="AB123456789this_code_is_untested"; my $match=substr $string, 0, 11;
$string=~/^([a-zA-Z]{2}\d{9}).*/; print $1;
CU
Robartes-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Newbie reg.exp question!
by RuneK (Sexton) on Nov 13, 2002 at 13:54 UTC | |
by robartes (Priest) on Nov 13, 2002 at 14:01 UTC | |
by fglock (Vicar) on Nov 13, 2002 at 14:02 UTC | |
by RuneK (Sexton) on Nov 25, 2002 at 12:37 UTC | |
by RuneK (Sexton) on Dec 16, 2002 at 15:01 UTC |