http://www.perlmonks.org?node_id=464614


in reply to regex problem

You're probably looking for something along these lines:

/^If[^f]/ # If followed by anything that is not f

The regex /^If?/ matches both your cases because you're looking for I followed by 0 or more 1 f's, so even Ig would match. The /^If{1}/ also matches both because both strings start with If, i.e. I followed by exactly one f. The second string has an additional f, but that particular regex is not concerned about that.

Update: rev_1318 is right, of course (see this node)

CU
Robartes-