Well, you're pretty close. Try this:
^+?[0-9/.()-]{9,}$
Without the start and end anchors you allow partial matching, so it can match +123
from the string :-)+123
.
If you want a minimum of 9 digits, rather than any characters (so ---...///
isn't valid), you can use:
^+?[/.()-]*([0-9][/.()-]*){9,}$
or, using a lookahead - before matching the string for [0-9/.()-]*
the regex engine is looking for (D*d){9}
, which is a of 9 digits, each digit possibly preceded by other characters (which we will validate later).
^+?(?=(D*d){9})[0-9/.()-]*$
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…