Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
 
Old September 13th, 2010, 08:36 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
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.
 
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
 
Old September 14th, 2010, 06:10 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
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.
 
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
 
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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.