Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 28th, 2008, 04:05 AM
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Regular Expression repeat problem

Hi,

I am using the asp:RegularExpressionValidator to create regular expressions. I am building a form in which a student enters the name of an author (or authors) that will then generate a bibliography for them. I have no issues with the following fields

Hogg,G = [a-zA-Z]*[,][a-zA-Z]*

Hogg,G & Hogg,C = [a-zA-Z]*[,][a-zA-Z]*\s[&]\s[a-zA-Z]*[,][a-zA-Z]*

However this is where I run into problems. I have no guarantee how many authors there will be. For example, Hogg,A, Hogg,B, Hogg,C, Hogg,D & Hogg,E

or it could be

Hogg,A, Hogg,B, Hogg,C & Hogg,D

I know that the * and + is what is used for repeat expressions. I have tried various expressions but nothing will work. I am working with this expression - notice the brackets for grouping.

([a-zA-Z]*[,][a-zA-Z]*[,]\s[a-zA-Z]*[,][a-zA-Z]*[,])*\s[&]\s[a-zA-Z]*[,][a-zA-Z]

Hogg,A, Hogg,B, Hogg,C, & Hogg,D won't work with it

but

Hogg,A, Hogg,B, & Hogg,D will work

I don't get it, what am I doing wrong?

Reply With Quote
  #2 (permalink)  
Old May 28th, 2008, 06:45 AM
Authorized User
Points: 308, Level: 6
Points: 308, Level: 6 Points: 308, Level: 6 Points: 308, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2006
Location: Kolkata, West Bengal, India.
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Your problem is regarding regular expression. You can post your problem in the following site -
http://regexadvice.com/forums/



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Regular expression problem keyvanjan ASP.NET 2.0 Basics 0 May 28th, 2007 12:19 PM
regular expression problem muki XSLT 2 January 11th, 2006 06:04 AM
Regular Expression (Big Problem) vinod_yadav1919 Javascript How-To 6 November 3rd, 2004 05:24 AM
Regular expression problem ghalebro PHP How-To 1 August 24th, 2004 08:10 AM
Regular Expression problem Mitch PHP How-To 2 May 14th, 2004 07:43 AM



All times are GMT -4. The time now is 06:07 PM.


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