sealabr
sealabr

Reputation: 1662

Asterisk Dialplan Phone exten to RegEx

Need to build a RegEx, that came from asterisk dialplan (Brazil Number)

valid      = 0021987126408
not valid  = 002198712640
not valid  = 3021987126408
valid      = 0021987126408

need to validate asterisk with dialplan => 00ZX[789]XXXXXXXXX

check in order .....

basicly transcribe asterisk Dialplan to Normal REGEX.

Upvotes: 1

Views: 809

Answers (1)

Rafael Calino
Rafael Calino

Reputation: 130

RegEx = ^(00\d{2}[7-9]\d{8})$

valid      = 0021987126408
not valid  = 002198712640
not valid  = 3021987126408
valid      = 0021987126408

Upvotes: 2

Related Questions