473,809 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the Regular Expression for a 6 digit Phone number field

50 New Member
Hi !

Can u tel me what is the expression (Regular expression) for the a field like Telephone number which Doesnt exceeds 6 digits

Ex:999999
d{5} or ([0-9])*

Can we use this expression , if its Wrong , kindly Suggest me the Correct one !

Thanks in Advance !
Sep 17 '07 #1
1 2455
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
im very bad at regular expression but [0-9]{6} should be good
if you want the first digit to be a non zero then [1-9]{1}[0-9]{5}
I hope this is right!.
Cheers
Sep 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2021
by: Graham Mattingley | last post by:
Hi, I have an issue where by when I use XMLHTTP to get data from another web site, all of the '£' symbols become '?'. I have try for hours to stop this happening but have been unsuccessful so far. The numbers I have for example should be £9.57 and become ?9.57. I am by no means an ASP expert and I have found some of the suggestion a bit difficult to understand, somebody suggested "ADODB.Stream" but I could not make this work..
1
1501
by: Al Jones | last post by:
This was originally posted in the VBScript forum, several of my other questions have been vbscript related, one of the fine fellows there suggest I might want to post it as well in the jscript group, so since I'm heading toward staching these values in session vars I figured I'd toss it out here as well.. I'm back with something that makes no sense to me .... as far as I can see the three if statements are identical except for the...
10
2222
by: Jeff Sandler | last post by:
I have a page that accepts input from many textboxes. Many of the textboxes are intended to accept dates and times, thus, I expect only digits to be entered. I originally tested using parseInt and isNaN, but I'm not even sure that the results are as perfect as I need. I am expecting to use RegExp.test(string), but I'm not 100% sure about that, either. Here is a test program with a textbox that has a maxlength of 2 characters. The...
3
4356
by: Danny | last post by:
I am trying to do a regular expression to search for a url so anything that has http:\\www.hellothere.com but may not have the http:\\ and may not have the www and may not have http:\\www and should work for upper and lower case I tried this:
4
1760
by: Arne | last post by:
Hi, I'm trying to recognise phone numbers on the following format using regular expressions: +47 123 45 678 This should be recognised by the following regular expression: +47 \d{3} \d{2} \d{3} but it's not. This regular expression: +47 \d{2} \d{2} \d{2} \d{2} DOES recognise the following phone number: +47 12 34 56 78
3
299
by: brian | last post by:
I am trying to write a reqular expression to validate the following: Needs to be 6 numbers First number between 1-4 Second number between 1-8 4-6 Numbers any number ^|/d{1}/d{1}/d{1}/d{1}$
1
2130
by: venu | last post by:
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should accept any number of numbers
3
6792
by: venu | last post by:
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should accept any number of numbers
11
3117
by: Steve | last post by:
Hi All, I'm having a tough time converting the following regex.compile patterns into the new re.compile format. There is also a differences in the regsub.sub() vs. re.sub() Could anyone lend a hand? import regsub
0
9603
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
10378
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...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
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
7664
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
5550
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
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.