C:\>perl -e "use YAPE::Regex::Explain; $REx = '?<[ ]*LOGIN[ ]?'; print $exp = YAPE::Regex::Explain->new($REx)->explain" The regular expression: matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ) end of grouping ---------------------------------------------------------------------- C:\>perl -e "use YAPE::Regex::Explain; $REx = qr/?<[ ]*LOGIN[ ]?/; print $exp = YAPE::Regex::Explain->new($REx)->explain" Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HERE <[ ]*LOGIN[ ]?/ at -e line 1.