Jump to content

Dial-Plan REGEXP Query


Krom

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

(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...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...