in reply to need help with a regex

I think you will get much better help if you are more specific and include a actual example of what you want want to parse -- since you have admitted your regexp doesn't work, it is hard to deduce what you are trying to do.

Eg, [VMFWLCA]{,8} is invalid (there must something before the comma), but presuming you mean "at least once, and a maximum of 8 times" (which would be {1,8}) then $1 could be any of these:

VVVVV
FMFMWWWL
C

Is that what you are trying to match?

Replies are listed 'Best First'.
Re^2: need help with a regex
by aquinom (Sexton) on Oct 22, 2010 at 20:34 UTC
    {,8} is perfectly valid it means a maximum of 8 times, but I meant to write {8,} anyways which means at least 8 times.
      {,8} is perfectly valid it means a maximum of 8 times

      {,8} is a perfectly valid string which in a regular expression matches the character '{' followed by the character ',' followed by the character '8' followed by the character '}'.    Perhaps you are thinking of the quantifier {0,8}?

        It is a quantifier in the context I wrote /VILMWFCA{8,}/ it's quantifying the number of residues to be at least 8 sequential residues from VILMFWCA.