Accept empty phone numbers

Y

Yo

Hello,

I am new at XSD schema.
In a schema, I have a regular expression used to check a phone number.
This expression works, but I'd like to allow also an empty string for
phone numbers.

Is there a simple way for me to modify my regular expression for that
in my XSD schema ? And if not, how can I achieve it ?

Thank you for your help.
 
M

Martin Honnen

Yo said:
I am new at XSD schema.
In a schema, I have a regular expression used to check a phone number.
This expression works, but I'd like to allow also an empty string for
phone numbers.

Is there a simple way for me to modify my regular expression for that in
my XSD schema ? And if not, how can I achieve it ?

If you wrap your expression in
()?
e.g.
(\d{5} \d{4,10)})?
it should work I think.
 
Y

Yo

Après mûre réflexion, Martin Honnen a écrit :
If you wrap your expression in
()?
e.g.
(\d{5} \d{4,10)})?
it should work I think.

That's exactly what I did while thinking by myself, and it works
perfectly. Thank you anyway for your idea ! ^^
 

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

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top