Hi,
I usually use nano text editor for my programming needs and have loved the text highlighting feature. It really makes programming much faster, and just by doing nothing by colour coding the different types of syntax.
There is just one problem that bugs me, and I have tried to make it work, but I feel I have lost a lot of what I learned about regex (back in my PERL days).
The problem arises when I'm using an HTML link in my code. The '//' in the address causes nano to comment out the rest of the address, like it was a comment.
I would like to have nano comment out everything after '//' except when it is '//:'.
My first work around was to change:
Code:
color brightblue "//.*"
to this:
Code:
#color brightblue "//[[:space:]].*"
It works, but requires all comments '//' to be followed immediately with a space '// '. But I don't like having to increase my keystrokes by 1/3 every time I want to comment out a few lines for debugging purposes.
I was revisiting the problem when I came across the regex negation operator. It looks like it should be what I need to fix this problem, but I'm not able to get it work. Thinking it should work, I tried the following:
Code:
#color brightblue "//(?!:).*"
Can someone please shed some light on this for me?
Ty