If you’re a novice like me I hope you can gain something from my ramblings.
Most modern programming languages have support for regex (regular expressions) but I’ll be focusing on Java Script’s implementation because that’s what I’m best at!
It can be reduced to a specific set of countries only but that wouldn't be an option for a worldwide international solution.
Regular Expressions offer a concise and powerful search-and-replace mechanism.
They are patterns of characters used to perform search, extract or replace operations on the given text.
Sun added support for regular expression in Java 1.4 by introducing regex package.It doesn’t really matter though because the typical regex notation varies little between implementations (As far as I know).