Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
((?:(?!(?:\d+(?:\s*\((?:\d+\/?)+\))?)).|\s)+)(\d+(?:\s*\((?:\d+\/?)+\))?)
/
g

Description

This regex match group (country & Prefix) Separated by spaces or \s+ ↓↓ Example ↓↓ Australia 61 Dominica 1 (767) República Dominicana 1 (809/829/849)

Group 1 (Country)Group 2 (Prefix)
Australia61
Dominica1 (767)
República Dominicana1 (809/829/849)
Submitted by https://github.com/hzvvictor - a year ago (Last modified a year ago)