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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top