0

Hi I am using a regex to match UK phone numbers which looks like below:

/^\(?0( *\d\)?){9,10}$/

http://regexr.com/39icf

I've tried testing the regex above but receive no matches for the numbers input which look valid to me.

Is my regex correct?

6
  • what do you expect to match , add a few examples Commented Sep 24, 2014 at 10:53
  • On regexr, have you turned on the "multiline" and "gloabal" flags? Commented Sep 24, 2014 at 10:54
  • The regex matches my home phone number fine. Can you provide an example that you think should match but does not. Commented Sep 24, 2014 at 10:55
  • 1
    I'd be very careful trying to use RegEx for phone numbers, there's so many formats that you may miss. How about the difference between (01234)567890, (01234) 567890, +44(0)1234 567890, +441234567890, etc. Commented Sep 24, 2014 at 10:55
  • 2
    I'm confused, what does this have to do with c#? Generally I'd write off the tag and edit it out, but I see you included it in the title as well. Is it actually relevant in a way I'm just not seeing? Commented Sep 24, 2014 at 11:00

1 Answer 1

3

It's working correct but you forget to select these checkboxes:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.