Validating US phone number with php/regex
You can resolve this using a lookahead assertion. Basically what we’re saying is I want a series of specific letters, (e, ex, ext, x, extension) followed by one or more number. But we also want to cover the case where there’s no extension at all. Side Note, you don’t need brackets around single characters like … Read more