Re: a regex question ..



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
.



Relevant Pages

  • Re: How to extract left-most number from a string
    ... John, thanks for catching that! ... Can I hit you up for one more: How can I count the number of periods ... , after a single digit, it returns a value error. ... "Roger Govier" wrote: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: How to extract left-most number from a string
    ... Thanks John. ... read as ellipses instead of 3 dots, so, modifying Ron's formula would be as ... , after a single digit, it returns a value error. ... Roger Govier ...
    (microsoft.public.excel.worksheet.functions)
  • Changing 77 777 to 77,777
    ... Is there a way of replacing these spaces with ... special character to mean "any single digit". ... Prev by Date: ...
    (microsoft.public.word.newusers)
  • Re: For Barb and Geoff Thursday 6-10-05
    ... > Thank you John. ... Congratulations Barb and Geoff. ... Prev by Date: ...
    (uk.people.silversurfers)
  • Re: a regex question ..
    ... Thanks John - will follow up on this. ... Geoff ... >Of course TMTOWTDI. ... Prev by Date: ...
    (comp.lang.perl.misc)