in reply to self limiting regex help

To limit the number of 'special' character you may have in a matching text, you could use this:
/[RYMKSWHBVDN]{0,2}/i
However, I'm not quite sure how to integrate this piece that would also satisfy this requirement:
any number of A,T,C,G ...
Could you try something along those lines:
/[ATCG][RYMKSWHBVDN]{0,2}/i
Oww, but then, they could be mixed right?

UPDATE: Oh well, I believe solution offered by ferrency is somewhat closer to what you need (Note: I didn't notice his solution until I actually submitted my alternative ;/)

_____________________
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+) +-.*)$/;$_=&#91"ps -e -o pid | "," $2 | "," -v "," "]`@$_`?{print" ++ $1"}:{print"- $1"}&&`rm $1`;print"\n";}

Replies are listed 'Best First'.
Re: Re: self limiting regex help
by spq (Friar) on May 22, 2002 at 15:43 UTC
    Thanks.

    Although they can be mixed, I suppose stating that there can be any number of ATCG's may mislead. Now that I read your post, I think I may have been getting hung up on that myself. Other QC regex's applied ensure that the string contains only the allowable characters as a class. The current methodology I've applied is to get all relevant QC expresions from the database and try each expresion in turn against the string. Currently there is no ordering, and I don't think that should matter, if all pass. But I could add it.

    So the real factor is only whether or not there are multiple occurances of more than 2 of the allowable class of alternate codes.