- February 1, 2014 at 4:33 am #17951
Can anybody give me an example of how do I use regular expressions in syntax highlighting file (*.esy) to do either one of the following:
1. How to not consider
'$#myArray'a comment? (In Perl, the highest value of the index in
@myArraycan be obtained as
2. How do I treat a Perl keyword as a variable name when it is prefixed with a ‘sigil’ namely
'$', '@', '%'or
'&'? (For example,
'date'is a keyword, but
$dateis a perfectly legal variable name.)
3. Similar to the above, how do I treat a Perl object method name as such, even if it is a keyword? (For example, the
$myObject->warnis a ‘method’ of the object
'$myObject', not a Perl keyword.)March 24, 2014 at 10:21 am #18131
1. Currently, there is no smart way, but you can specify “# ” as a line comment (insert a space at the end of ‘#”), and make sure to use a space after ‘#’ for every comment line.
2.3. You could use regular expressions – negative lookbehind search (?< !\$)date , or (?)warn , but that could slow down the process.
Thanks!March 27, 2014 at 3:43 am #18142
Your suggestion cannot be used universally. e.g., when my legacy code has some commented-out segments, they now come back to life. Also, frames such as:
are considered “code”.
But your syntax does refer to RegEx:
And finally, Can the RegEx-enhanced syntax highlighting files be moved up your priority list please?January 28, 2016 at 12:10 am #20598
I am trying desperately to make the syntax highlighting of perl accept ‘$#’ as color = 4 and not as $ followed by comment. So far no success 🙁
The relevant lines I tried:
#Keyword color=4,word=off,rightall=off,case=off,insidetag=off,regexp=on,rightall2=off /\$\#/
Please complete the RegExp…
Many, many thanks
— MeirJanuary 28, 2016 at 2:51 pm #20599
This looks good. What exactly is the issue here?
You may post screenshots or send me screenshots to provide more information.
You must be logged in to reply to this topic.