#!/usr/bin/perl -w
$_= qq/"text with actual quotes"/;
# Strip quotes
s/^"//;
s/"$//;
See those double quotes in lines six and seven? The syntax highlighter thinks everything from the middle of line six to the middle of line seven is quoted, but it's not or course. It's much worse when you have a line with one quote and no other line like that for a long time. You either have to turn off multi-line quoting of do something like this:
How should Textpad determine whether a " starts a string or is a single character?
No, the s/ can't be used to determine that as the / in s/ can be replaced by any other charater, e.g.
s#^"##;
This would need a full perl parser...
I don't think this will be implemented in Textpad, perl syntax is extremely complex...
Perl syntax highlighting is now handled by its own lexical scanner, to make it more robust in detecting when # starts a comment. This requires use of the new perl5.syn syntax definition file.