I use an older language that doesn't have any prebuilt syntax highlighters.
Although notepad++ has user defined language features there are some cases that aren't supported. For these cases I use a python script that applies syntax highlighting using regex.
My current issue I have run into is using regex to find patterns within curly braces. The pattern I'm trying to match is [A-Za-z_]\w*
.
So basically, a variable name. However I would like to match only instances that occur within double curly braces.
In the following string I would like to match both instances of TimeStamps
and Descending
and nothing else.
Test Test2'{{TimeStamps(Descending(1))(7:8)}}/{{TimeStamps(Descending(1))(1:4)}} - '
I have tried variations of this (?<={{)([A-Za-z_]\w*)*(?=[0-9\(\)\:]*}})
, however it feels like I'm over complicating it for myself.
Any help is appreciated. Thanks in advance.