Reputation: 2197
Please help me. I have no effective idea in field of regular expression
Upvotes: 0
Views: 143
Reputation: 44259
This is one possible solution:
^\+?(?:\d-?){9,14}\d$
Explanation:
^ # anchor the pattern to the beginning of the string
\+? # optional literal +
(?:\d-?) # a digit, followed by an optional hyphen
{9,14} # 9 to 14 of those
\d # another digit (to make that 10 to 15, and disallow hyphens at the end)
$ # anchor the pattern to the end of the string
Upvotes: 3