That is close, but required the A when he's allowing just "B".  Also, he 
gets some E's there in the end.

I'd look at this:
^A?[123]?[B-E]?$

The big caveat there is that it allows the empty string, so you might 
want to also take a look and make sure they actually submit something.

--Ben

CF wrote:
> Hi Michael.
> 
>> sorry for OT but I need your help RegEx gurus. 
> 
> As long as it's CF related, it is not OT. Just my $0.02 ;-)
> 
>> In my form
> users can
>> insert a field with this pattern:
>>
>> A|1-3|-B|C|D
>> In resume can insert ?
>> A or
>> A1B or
>> A2B or
>> A3B or
>> A1C, A2C, A3C, A1D, A2D, A3D, A1E, A2E, A3E, AB, AC, AD, B, C, D
>>
>> Validating only letters work fine but that all combinations fail.
> 
> OK. Start with letter A, followed bei 0 or 1 occurence of 1 though 3,
> followed by 0 or 1 occurence of B through D. Correct?
> 
> Then the following reg exp. should do:
> "A([123]?)([BCD]?)"
> 
> Best,
> 
> Chris
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234253
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to