473,739 Members | 7,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

paterns for phones' numbers

Hello.

I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.

thanx in advance
greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #1
8 2099

"Ruthless" <ruthless@NO_SP AM.poczta.onet. pl> schreef in bericht
news:bs******** **@atlantis.new s.tpi.pl...
Hello.

I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.


<!-- matches 111-222-333 formatted phone numbers -->
<xs:simpleTyp e name="phoneType ">
<xs:restricti on base="xs:string ">
<xs:pattern value="[0-9]{3}(-[0-9]{3}){2}" />
</xs:restriction>
</xs:simpleType>

You will have to re-specify the pattern with other formats.
HTH,
JW

Jul 20 '05 #2
thnx very much

greetings R

Użytkownik "Janwillem Borleffs" <jw@jwscripts.c om> napisał w wiadomo¶ci
news:3f******** *************@n ews.wanadoo.nl. ..

"Ruthless" <ruthless@NO_SP AM.poczta.onet. pl> schreef in bericht
news:bs******** **@atlantis.new s.tpi.pl...
Hello.

I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.


<!-- matches 111-222-333 formatted phone numbers -->
<xs:simpleTyp e name="phoneType ">
<xs:restricti on base="xs:string ">
<xs:pattern value="[0-9]{3}(-[0-9]{3}){2}" />
</xs:restriction>
</xs:simpleType>

You will have to re-specify the pattern with other formats.
HTH,
JW

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #3
On Wed, 24 Dec 2003 14:15:17 +0100, "Ruthless"
<ruthless@NO_SP AM.poczta.onet. pl> wrote:
I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.


Don't ! Phone numbers don't need structure - you just dial them and
they work. Trying to impose a structure like this causes no end of
problems (I used to write commercial desktop apps - I learned this
_years_ ago).

There's also the problem that different countries use different
format, and that one country may often change an existing format. If
you really must have formatted numbers, just do it at the display
stage.
--
Klein bottle for rent. Apply within.
Jul 20 '05 #4
Take for example Australia where landline phones are now 01 2345 6789 and
mobiles phones are 0412 345 678. The list could be endless. Content
yourself with formatting the field as text and checking if there are enough
characters to create a meaningful phone number.

Gargamil

"Andy Dingley" <di*****@codesm iths.com> wrote in message
news:4i******** *************** *********@4ax.c om...
On Wed, 24 Dec 2003 14:15:17 +0100, "Ruthless"
<ruthless@NO_SP AM.poczta.onet. pl> wrote:
I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.


Don't ! Phone numbers don't need structure - you just dial them and
they work. Trying to impose a structure like this causes no end of
problems (I used to write commercial desktop apps - I learned this
_years_ ago).

There's also the problem that different countries use different
format, and that one country may often change an existing format. If
you really must have formatted numbers, just do it at the display
stage.
--
Klein bottle for rent. Apply within.

Jul 20 '05 #5
Gargamil wrote:
Take for example Australia where landline phones are now 01 2345 6789 and
mobiles phones are 0412 345 678. The list could be endless. Content
yourself with formatting the field as text and checking if there are enough
characters to create a meaningful phone number.


Recently, I purchased international plane tickets via the web. Several
minutes later, I got an email from the travel agent complaining of an
invalid number. Their software evidently was looking for a number with
the typical US format of 987-654-3210, but I had put a "1" in front of
my US number out of habit because that's the country code. The effect
is that the software incorrectly rejected my valid number. That's bad
design.

Ed

Jul 20 '05 #6
Andy Dingley wrote:
On Wed, 24 Dec 2003 14:15:17 +0100, "Ruthless"
<ruthless@NO_SP AM.poczta.onet. pl> wrote:

I've got a question how to make a patern in XML Schema for e.g. phones'
numbers like this: 111-222-333 etc.

Don't ! Phone numbers don't need structure - you just dial them and
they work. Trying to impose a structure like this causes no end of
problems (I used to write commercial desktop apps - I learned this
_years_ ago).


Right. But *do* allow the user to type non-digits:

a. optional + at the start to symbolize your international access code
b. spaces between groups of digits
c. hyphens (dashes) between groups of digits
d. slashes...
e. parentheses...
f. periods...
g. etc

I believe the maximum length of a phone number is currently 18 digits
(max 4 for country code, max 6 for area code, max 8 for number) plus
up to 6 more for direct in-dial extensions, and whatever you consider
reasonable for punctuation (say 8), giving a total for your overall
length of 32.

Formatting is tempting, because at least 15% of respondents will get
their own phone number wrong, IMHE. But it's too complex to model in
a Schema: the ITU will supply you with the standard formats for each
country if you really want them, but you'll spend the next year making
them work as patterns.

///Peter

Jul 20 '05 #7
Peter Flynn wrote:
...

a. optional + at the start to symbolize your international access code
...


So any number that doesn't start with a "+" is in which country?

Julian
Jul 20 '05 #8
(Oops, I think I just contrived to send a reply to this to xml-dev by mistake.)

In article <bu************ @ID-163087.news.uni-berlin.de>,
Peter Flynn <pe***@silmaril .ie> wrote:
Don't ! Phone numbers don't need structure - you just dial them and
they work. Trying to impose a structure like this causes no end of
problems (I used to write commercial desktop apps - I learned this
_years_ ago).
Right.


Really? It used to be the case that in Britain that dialling the full
"long-distance" version of a local number *didn't* work; you had to
extract the local part. I think it now generally works, but I wouldn't
bet on that being the case everywhere.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5263
by: Thomas Weholt | last post by:
Hi, Is it at all possible to use python to make apps on cellular/mobile phones, using something like Jython etc. ? Hm ... ?? Thomas
0
1804
by: Carlos Eduardo Peralta | last post by:
Hello dotnet frineds: I make a decision in the 2001 year: i want to be a dotnet guru. I want to consume all my learning hours just learning this applications plataforms and NOT THE JAVA ONE. I realize yesterday with a lot of pain that that kind of cell phones (motorola) have the Java runtime in the firmware! FUCK! Do you know if i can make complete apps for that phones or it there is
22
13770
by: ineedyourluvin1 | last post by:
Hello all! I've been looking for a way to strip characters from strings such as a comma. This would be great for using a comma as a delimiter. I show you what I have right now. #include<iostream> #include<string> int main(int argc, char *argv) {
2
1767
by: HateSpam | last post by:
Can I develop cell phone apps with VB .NET? What would you suggest as a target phone for testing, and would I need any other special equipment? Are there any good books for developing for this platform?
3
2813
by: squash | last post by:
I have a client who wants to be able to automatically send a text message to a cell phone after a user submits a form with a valid cell phone number. Is this possible? Which websites provide this service, if any? Is there an api for it?
4
1810
by: JCR | last post by:
Hi, Programing for smart phones/pda/pocket PC... can be difficult because of the number of operating systems and the variety of devices. Is anyone aware of a cross-operating system/cross-device environment to write programs in C++. Open-source or not! Or maybe there is no such thing and the solution is to set up a specific project for each target? Thanks in advance
2
2021
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you for any and all assistance in finding information on this, it is greatly appreciated. I have a client that wishes to integrate into a desktop application three things from an Access 2000 database and program created for their operations. They would like to be able to text message from this program to Wireless/Cellular phones: Can this be done? If so, where would one research code to do this in VB.NET 2005?
5
1942
by: Stefano Peduzzi | last post by:
Hi, I'm building an application where I've defined a custom class Customer. Customer can have many phones (defined by phoneType and phoneNumber). I want to check that a phoneNumber is not already present in customer phones. So i've build a PhoneCollection class inheriting for List<Phoneand defined an Add method to check if the phoneNumber already exists. Then I added the PhoneCollection to Customer properties. Everything works fine, and I...
1
1837
by: rote | last post by:
I'm out for a regex expression to validate mobile phones like +61408777888 or 61405673777 and not letters allowed Thanks in advance
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6054
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.