Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > BOOK: Beginning Regular Expressions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Regular Expressions
This is the forum to discuss the Wrox book Beginning Regular Expressions by Andrew Watt; ISBN: 9780764574894
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Regular Expressions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 12th, 2010, 09:15 PM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Post Simple question again?

Hi, everybody, I met another question again.

How to implement below function.

A Regular expression,contain three number appear at the same time or not.
Not more than one.
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng
  #2 (permalink)  
Old September 13th, 2010, 08:36 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Sorry, I don't understand the question.

First you say "contain three number" but then you say "not more than one". Which is it??? 3 or 1???

Maybe give some examples of what is okay and what is not? That would be better.
  #3 (permalink)  
Old September 13th, 2010, 09:18 PM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Post

yeah. I mean this regular expression must have three numberic in it.

and This regular expression appear not more than one.
This three numberic is a whole, appear or disappear?

Could u understand me?

Code:
123
234456789908
The regular expression will told me.
123
234
456
789
908

is Matched.
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng
  #4 (permalink)  
Old September 14th, 2010, 06:10 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ugh. I don't know. I'm not sure I could write a single regular expression to do that. Even it if it is possible, it would be very very hard. Harder than I can do.

Sorry.
  #5 (permalink)  
Old September 15th, 2010, 03:20 AM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Post

Anyway, Thank u very much.
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng
  #6 (permalink)  
Old September 22nd, 2010, 01:44 AM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Post

This is the answer
Code:
\d{3}[-]?\d{8}[-]?\d{3}?
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng
 


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple question VBAprutser VB How-To 2 August 20th, 2007 06:00 AM
Simple Question ironchef Spring 2 April 30th, 2007 09:32 AM
Simple Question ironchef Java GUI 0 September 14th, 2006 04:56 PM
Simple Question dinosaur_uk VB.NET 2002/2003 Basics 1 September 10th, 2004 09:43 AM



All times are GMT -4. The time now is 10:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.