Emacs is confusing syntax after a line like
fileparse($file, qr"\.[^.]+$");
And thinks the rest of the file is a string. How do I fix this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Emacs is confused by the quotes in the
qrexpression. The standard regular expression delimiter (/) works:In fact, almost anything else seems to work.
My version of VIM doesn’t get confused by the quotes, but I know that older versions of VIM did. Putting quotes is really confusing because it makes the
qrexpression look like a string (which it isn’t). It’s usually bad policy to use quotes as delimiters in regular expressions even though it’s technically legal.However, the really important question is what’s
fileparse? That’s not a standard Perl function. I am assuming that this is imported fromFile::Basename? Would that be correct?According to the documentation I have, the second argument in
fileparseis suppose to be an array and not a quoted regular expression.