I'm looking for a regex to use in Java (java.util.regex.Pattern) that will match a generalised form of a telephone number. I've specified this as being:
a sequence of at least 8 non-letter characters with at least 8 characters being digits.
For example of a string literal with a positive match would be:
"Tel: (011) 1234-1234 blah blah blah"
however the following string literal would not match:
"Fot 3 ..... a 3 blah blah blah"
I've got as far as matching a sequence of at least 8 non-letter characters
Pattern.compile("[^\\p{L}]{8,}");
How can I add an "and" / "conjuncive restriction" onto that regex specifying [\d]{8,}
I saw this post on stackoverflow:
Regular Expressions: Is there an AND operator?
About "anding" regex expressions but I can't seem to get it to work.
Any help or suggestions, very welcome:
Simon