EmEditor (text editor) Forum Index
   Regular Expressions
     Need help on setting syntax highlight with RegEx
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
ToadLoadin
Posted on: 2/12/2012 5:15 am
Just can't stay away
Joined: 7/4/2008
From: China
Posts: 119
Need help on setting syntax highlight with RegEx
Hi, I'm writing some little AHK scripts to help my daily work, so I'm tweaking around the ahk syntax highlight configs.

Since I want to highlight subroutine labels of ahk script, I tried this pattern:
^\s*\w+:(?=\s*$|\s*;.*$)

Which means words and a colon follows some space or right at the beginning of the line.

The "(?=\s*$|\s*;.*$)" part is a positive lookahead search, which means I want to have it could be followed by spaces or a line comment (; blah blah...), but it does not work as I expected, it can only be followed by spaces, once there is some comment followed, the highlight goes off.

Could anybody give me some hints how to correct it?



Flat Previous Topic | Next Topic


Subject Poster Date
 » Need help on setting syntax highlight with RegEx ToadLoadin 2/12/2012 5:15 am
     Re: Need help on setting syntax highlight with RegEx Stefan 2/12/2012 12:44 pm
       Re: Need help on setting syntax highlight with RegEx ToadLoadin 2/12/2012 8:16 pm
         Re: Need help on setting syntax highlight with RegEx ToadLoadin 2/12/2012 8:19 pm
           Re: Need help on setting syntax highlight with RegEx ToadLoadin 2/13/2012 5:12 am
             Re: Need help on setting syntax highlight with RegEx Yutaka 2/13/2012 9:23 am

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文