-1

I need a regex to allow numbers and some special characters like + . - ( ).
The Phone number formats my like.

9999 999 999
9999999999
999999
+91 99 99 99 9999
999.999.999
99 (999) 99 99 etc..

Like any format. Is there any one Help me.

I have tried Lot number of answers in stack overflow but I can't get better one.

chandu
  • 2,276
  • 3
  • 20
  • 35
  • did you want to match only numbers without special characters? – Avinash Raj Jul 11 '14 at 14:32
  • `I have tried Lot number of answers in stack overflow` - show them, we might be able to find something simple to fix – Ian Jul 11 '14 at 14:36
  • @lan. similar question is http://stackoverflow.com/questions/3256547/regex-simple-phone-number.. any many are there – chandu Jul 11 '14 at 15:10
  • @chandu I meant show your attempts. Surely, regular expressions from other answer won't perfectly fit your need – Ian Jul 11 '14 at 17:10
  • possible duplicate of [A comprehensive regex for phone number validation](http://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation) – HamZa Jul 12 '14 at 03:00

1 Answers1

0

The below regex would match the lines which contains numbers and special characters(.+)(-),

^[-()+ .]?(?:[0-9]+[-()+ .]+)+[0-9]+$

DEMO

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274