Regular Expressions 101

Community Patterns

GET country, prefix extended

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 - 9 months ago (Last modified 9 months ago)