# Find LOGIN tag. if ((($ln =~ ?<[ ]*LOGIN[ ]?) || ($ln =~ ?<[ ]*LOGIN$?)) && ($pword) && ($uname)) { ... } #### C:\>perl -e "/?/" Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HERE / at -e line 1. #### # perl -MO=Deparse -e '$ln=" < LOGIN > "; $ln =~ ?<[ ]*LOGIN[ ]?' $ln = ' < LOGIN > '; $ln =~ ?<[ ]*LOGIN[ ]?; -e syntax OK #### 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.