Hi,
Sergei's solutions can usually be used straightaway without
any
problems, but in this case, I have the honour of making a
correction
What dputz needs is :
1. Find all zeros at the start of string, followed by any
digit.
(Positive lookbehind)
2. Find all zeros followed by a hyphen, followed by any
digit.
(Positive lookbehind, then Positive Lookahead)
He needs to replace 000901-030 with 901-30, NOT 901-03.
So, the Regex can be amended to :
^(0+)(?<=\d)|(?<=-)0(?=\d)
Regards,
Cerebrus.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|