http://qs321.pair.com?node_id=168491


in reply to self limiting regex help

If I understand your conditions correctly, this should do:

print if /^ [ACGT]* ([RYMKSWHBVDN])? (?:[ACGT]|\1)*([RYMKSWHBVDN])? (?:[ACGT]|\1|\2)*$ /ix;

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

    Eureka! I was just attempting to do something similar, but had discovered that \n doesn't work in a character class.

    Thank you (and everyone who responded) very much for your help!