bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

It is a problem with perl's regex syntax


From: Florian v. Savigny
Subject: It is a problem with perl's regex syntax
Date: 22 Oct 2000 11:23:20 +0200

I am sorry, I just found out myself:

The root of the problem seems to lie in line 6; that is,
when you type:

if ($zeile =~ /^Subject:(.*?$

and then type ")", perl-mode does NOT indicate that 
it matches the parenthesis five characters back. It does 
nothing. I think that it reckognizes "$)" as a variable; 
while to Perl, $ is not a variable prefix here because it is
at the end of a regular expression and thus a special regex
character. -- As you go on typing "/), the cursor indeed 
jumps to the opening parenthesis that the beforementioned
")" after the "$" already should have matched.

So, the problem seems to be that perl-mode is only partly
aware of Perl's syntax.

Does anybody know a more sophisticated (or updated) mode?
As you can imagine, the wrong indentation takes place in
the whole rest of the script, which is the opposite of
helpful.

Else, if the only workaround is to write the code in a
compatible form (for instance, in this case it would do
to write "/^Subject:(.*)/" (I don't know why I wrote the
question mark, by the way, but it didn't hurt)):

   -- who knows of similar problems (and workarounds)?


Thanks a lot!

                        Florian von Savigny
___________________________________________
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]