Re: a regex question ..
- From: Geoff Cox <geoff.cox@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 20:34:59 GMT
On Sat, 30 Apr 2005 19:22:31 GMT, "John W. Krahn"
<someone@xxxxxxxxxxx> wrote:
>( my $newname = "new-$name" ) =~ s/(?<!\d)(\d)(?!\d)/0$1/g;
John,
Thanks for the above - I can see from a book I have that
(?!\d)
means that there must not be a single digit ahead of the the single
digit, (\d), but does
(?<!\d)
mean there must not be a single digit in front of the (\d) digit?
I didn't know about the look ahead etc so thanks for that ....
Cheers
Geoff
.
- References:
- a regex question ..
- From: Geoff Cox
- Re: a regex question ..
- From: John W. Krahn
- a regex question ..
- Prev by Date: Re: perl versions and other stuff
- Next by Date: Re: Module file writing problem
- Previous by thread: Re: a regex question ..
- Next by thread: missing the boat
- Index(es):
Relevant Pages
|