Regular Expressions question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

How can I verify a valid phone number contain 0-9 and characters ( ) -
and whitespace.

for example:

(416) 424-1234 or 416- 424-1234 or 4164241234

how can i use from Regular Expressions (C#)?

thank you,
monica
 
hi,
How can I verify a valid phone number contain 0-9 and characters ( )
- and whitespace.

for example:

(416) 424-1234 or 416- 424-1234 or 4164241234

how can i use from Regular Expressions (C#)?

thank you,
monica


One way would be :
([() -]*[0-9]){10,}

- any of the characters '(', ')', space and '-', zero or more times
- followed by a single (!) digit
- and the whole thing repeated at least 10 times


Hans Kesting
 
How can I verify a valid phone number contain 0-9 and characters ( )
- and whitespace.
for example:
(416) 424-1234 or 416- 424-1234 or 4164241234
how can i use from Regular Expressions (C#)?
thank you,
monica

One way would be :
([() -]*[0-9]){10,}

- any of the characters '(', ')', space and '-', zero or more times
- followed by a single (!) digit
- and the whole thing repeated at least 10 times

Hans Kesting

Download Expresso, its a reg-ex solution builder. its free and good to
work on.

-
shashank kadge
 
Hi Monica,
Have a look at RegExBuddy.
It has a section that generates C# code for the regular expression that you
are generating.
HTH
Bob
 
hi,

How can I verify a valid phone number contain 0-9 and characters ( ) -
and whitespace.

for example:

(416) 424-1234 or 416- 424-1234 or 4164241234

how can i use from Regular Expressions (C#)?

thank you,
monica

The following tools are very helpful in writing and testing regular
expressions
- The regulator
- Regulazy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top