Advertisement

11.30.2007 at 11:08AM PST, ID: 22993999
[x]
Attachment Details

Combine regular expressions into one

Asked by gromul in Regular Expressions

Tags: combine, regular, expression

I have two validating regular expressions I'm not sure how to combine into one:

(?=^\w{1,10}$)(?!^\d+$) #Alphanumeric string up to 10 chars, can't be all just numbers
(?=^\w{1,20}$)(?!^[a-zA-Z]+$) #Alphanumeric string up to 20 chars, can't be all just letters

The valid input string would be in format: A\B where A is the first regex and B is the second. Any tips on how to do this?

ThanksStart Free Trial
[+][-]11.30.2007 at 11:14AM PST, ID: 20384500

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2007 at 11:18AM PST, ID: 20384536

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.30.2007 at 12:07PM PST, ID: 20384921

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.30.2007 at 12:21PM PST, ID: 20385029

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Regular Expressions
Tags: combine, regular, expression
Sign Up Now!
Solution Provided By: ddrudik
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628