Hi, Can somebody please help me with regex for phone no. for below mentioned format only xxxxxxxxxx xxx.xxx.xxxx xxx-xxx-xxxx
I don't give that because protocol96 might want to do something else so it is up to him whether he wants to use start/end (^ and $) or word boundaries. Besides, I wouldn't use word boundaries here as this is most likely for a single field so you wouldn't want to match something like this: http://example.com/spamspamspam 123-456-7890
I agree with that. But without boundaries it can match something like this: 123-123-45678 8123-123-45678 78123-1238456 And so on. Also I've chosen 3 separate regexps to avoid situations like: 123-123.1234 123123-1234 I think everything is up to protocol96 ; He has enough info here
\d{3}([.-]?)\d{3}([.-]?)\d{4} This is what I would use in perl, i don't think it needs the backslash before the . inside the []