Krom Posted March 17, 2008 Report Share Posted March 17, 2008 Query regarding syntax. Wishing to match 1+10-digit or just 10-digit in a single statement. The following works for matching NANP possible digits dialed: (1[0-9]{10})@.*|([0-9]{10})@.* Why doesn't the following work: (1?[0-9]{10}@.* Thanks for any hints or tips for a REGEXP match for NANP. -Krom Quote Link to comment Share on other sites More sharing options...
ap_6200 Posted March 30, 2008 Report Share Posted March 30, 2008 Query regarding syntax. Wishing to match 1+10-digit or just 10-digit in a single statement. The following works for matching NANP possible digits dialed: (1[0-9]{10})@.*|([0-9]{10})@.* Why doesn't the following work: (1?[0-9]{10}@.* Thanks for any hints or tips for a REGEXP match for NANP. -Krom Any updates to this question, I am having the same issue... Thanks Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted March 31, 2008 Report Share Posted March 31, 2008 (1[0-9]{10})@.*|([0-9]{10})@.* This pattern has the problem that the 2nd pattern group will be in the replacement parameter \2. You probably want "(1[0-9]{10}|[0-9]{10})@.*". (1?[0-9]{10}@.* There is a closing bracket missing. You can also try 1xxxxxxxxxxx|xxxxxxxxxxx. ERE are fun. If possible stay with the simplified patterns... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.