in reply to Re: A tidier regex ?
in thread A tidier regex ?

BrowserUk, I was thinking along the same lines on the regex, but you beat me to it and you've got better regexes than what I was coming up with.

Assuming that OP is concerned about the formatting (the two underscores in the first 'word' and starting strings for the next two 'words), I think a slight modification of your second regex could work to meet that need. Something like:

m[CDC_\w+?_\w+(?:,\s+DDC(?:S|R)MR\w+){2}]

Of course, I haven't tested that, so I wouldn't be surprised if someone was able to point out problem(s) in that regex.

Replies are listed 'Best First'.
Re^3: A tidier regex ?
by Anonymous Monk on Sep 14, 2010 at 13:43 UTC
    I don't think I explained the issue very well. The user will input a single word which could be either.

    CDC_*_* or

    DDC(SMR or RMR)*

    So if my limited knowledge or regex is correct the above doesn't match. I tested it . Hence my reply clarifying the issue. Sorry for any confusion caused.