Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi..
I use the below given regex to match numbers in these forms
Should Match : 1. 123-456-789 2. 123.789.456 3. 963 456 741 Should Not Match : 1. 123-456.789 2. 123 789-456 3. 963.456 741 Regex: (?<!\d)\d{3}[\d$diff]{3,10}\d{3}(?!\d)) $diff contains : -.
But the regex matches both SHOULD MATCH and SHOULD NOT MATCH .How can I make it match only SHOULD MATCH?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex Modification
by Athanasius (Archbishop) on Apr 10, 2013 at 06:57 UTC | |
by Anonymous Monk on Apr 10, 2013 at 07:29 UTC | |
by AnomalousMonk (Archbishop) on Apr 10, 2013 at 08:05 UTC | |
by Anonymous Monk on Apr 10, 2013 at 08:42 UTC | |
by AnomalousMonk (Archbishop) on Apr 12, 2013 at 10:09 UTC | |
| |
by si_lence (Deacon) on Apr 10, 2013 at 07:54 UTC | |
|
Re: Regex Modification
by AnomalousMonk (Archbishop) on Apr 10, 2013 at 07:53 UTC |