Using JS: Remove the spaces, then check \w
'foo baz barz'.replace(/ /g,'').match(/\w{10,}/) != null //true 'foo bar baz'.replace(/ /g,'').match(/\w{10,}/) != null //false
Match the phone numbers in the text:
var test = 'something foo baz barz 07999-777-111 and 01234 567890 01234567890 some more'.match(/((\(?0\d{4}\)?[ -]?\d{3}[ -]?\d{3})|(\(?0\d{3}\)?[ -]?\d{3}[ -]?\d{4})|(\(?0\d{2}\)?[ -]?\d{4}[ -]?\d{4}))([ -]?\#(\d{4}|\d{3}))?/g); //result: ["07999-777-111", "01234 567890", "01234567890"]
Smokeyphp
source share