From: Dv Dasari Date: 2010-11-03T07:04:51+09:00 Subject: Re: Regular Expression Kendall Gifford wrote in post #958838: > On Tue, Nov 2, 2010 at 3:34 PM, Richard Conroy > wrote: >> You are going to need some more advanced regexes to get a match in the way >> /^A?B?C?D{0,2}$/ >> > > The above works so long as each of ABC or D must come in said order, > if present. This goes against the OP's examples: CA, DAD, and BAC. > > My suspicion is that you're problem isn't solvable by a regular > expression alone, but that you'll need to do some parsing (still > possibly using regular expressions in the process). Yes, you are correct, this expression doesnt match words like CA or BAD or CAD. Just wondering if there is an option to say all different combinations or orders. -- Posted via http://www.ruby-forum.com/.