in reply to Error! Nested quantifiers in regex

? is special for the regexp machine. What you want is:
/^(?:RE:\s*|FW:\s*)*\Q$match_string\E$/

The \Q ... \E tells the regexp engine that anything in between should be taken "as is". I also removed the \i*. I do not know what you think \i is, but any string will end with zero or more of them. Finally, one uses ( ) or (?: ) for grouping, [RE:\s*|FW:\s*]* means something else. That would match any string consisting of whitespace, the capital letters E, F, R, W and the characters : and |.

Abigail

Replies are listed 'Best First'.
Re: Re: Error! Nested quantifiers in regex
by banduwgs (Beadle) on Sep 16, 2003 at 09:16 UTC
    Thank you, that's right. It works. Oh, "i" is a mistake, I don't have it in my code - SB