Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to extract the age digits only but it extracts the wrong digits (19) .my $text = 'my model TT1986 is 6 months old"; #my $text = 'my model TT1986 is 12 months old"; $text =~ /(\d?\d)/; print $1;
doesn't print anything. What's a girl supposed to do?? :)$text =~ /^\b(\d?\d)/; print $1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex extracting a number from numbers and text
by ikegami (Patriarch) on Oct 17, 2006 at 16:51 UTC | |
|
Re: Regex extracting a number from numbers and text
by Anonymous Monk on Oct 17, 2006 at 16:57 UTC |