Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Accept empty phone numbers

Reply
Thread Tools

Accept empty phone numbers

 
 
Yo
Guest
Posts: n/a
 
      11-08-2010
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.


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-08-2010
Yo wrote:

> 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.




--

Martin Honnen
http://msmvps.com/blogs/martin_honnen/
 
Reply With Quote
 
 
 
 
Yo
Guest
Posts: n/a
 
      11-08-2010
Après mûre réflexion, Martin Honnen a écrit :
> Yo wrote:
>
>> 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.


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert Phone Letters to Phone numbers Rene Ivon Shamberger C++ 5 12-05-2012 04:11 PM
Free Phone to Phone Calling.. From any phone to any other anywhere coolguy17111987 VOIP 0 07-01-2007 07:27 AM
Free Phone to Phone Calling.. From any phone to any other anywhere coolguy17111987 Cisco 0 07-01-2007 07:27 AM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
empty/non-empty element John XML 1 07-16-2003 10:23 AM



Advertisments