You can display the country code with a simple RegEx, for example:
^(?:(?:0(?:0|11)\s?)|+)([17]|2([07]|[1-689]\d)|3([0-469]|[578]\d)|4([013-9]|2\d)|5([1-8]|[09]\d)|6([0-6]|[789]\d)|8([12469]|[03578]\d)|9([0-58]|[679]\d))
Further
(([\s\(\).-]{0,2}\d){4,13})$
to extract the national number.
To check the national length and expiration date, you need libphonenumber or the like.
The long RegEx above allows +, 00 or 011 before the country code and the choice of punctuation by the number that will also need to be deleted.
g1smd
source share