Hi,
without learning PCRE, I plugged different nos in and this doesn't reformat the phone number. I'm also in the UK. I'll need to revisit at some point and do it properly, but if you want an ugly hack, here's the section I changed;
Code: Select allclass StringUtility
{
const matchPHSeparator = '[\s\/.-]*'; /* PCRE */
const matchPHCountryCode = '[(]?[+]?\d{0,3}[)]?'; /* PCRE */
const matchPHECountryCode = '[(]?[+]?(?P<countryCode>\d{0,3})[)]?'; /* PCRE */
const matchPHAreaCode = '[(]?[2-9]{1}\d{2}[)]?'; /* PCRE */
const matchPHEAreaCode = '[(]?(?P<areaCode>[2-9]{1}\d{2})[)]?'; /* PCRE */
const matchPHExchange = '\d{4}'; /* PCRE */
const matchPHEExchange = '(?P<exchange>\d{4})'; /* PCRE */
const matchPHNumber = '\d{4}'; /* PCRE */
const matchPHENumber = '(?P<number>\d{4})'; /* PCRE */
const matchPHExtension = '([(]?(?:e?xt?(?:ension|)|#|[*]|)[)]?[\s\/.-]*\d{1,6}[)]?)?'; /* PCRE */
const matchPHEExtension = '([(]?(?:e?xt?(?:ension|)|#|[*]|)[)]?[\s\/.-]*(?P<extension>\d{1,6})[)]?)?'; /* PCRE */
..otherwise if you want it 'correctly formatted for UK' then you can check out the UK compatible PCRE which is listed here
http://regexlib.com/UserPatterns.aspx?a ... eSupport=1