in reply to Re: regular expressions
in thread regular expressions

Slightly picky, but I'd use a character class to match the f or g. I'm pretty certain it'd be quicker, as perl isn't jumping through hoops to catch $1.
print "$_ matches!\n" if /^a.+[fg]$/;