In gedit, highlight a function call within the parenthesis


I’m currently editing my javascript.lang file to highlight function names.
Here is my expression for gtksourceview that I am currently using.

<define-regex id="function-regex" >

here’s the regex by itself


It appears to work for situations such as, foo(A) which I am satisfied with.
But where I am having trouble is if I want it to highlight a function name within the parentheses of another function call.


or to put it more rigorously


So with the example,


my goal is for it to highlight foo, bar, baz and nothing else.

I don’t know how to handle the bar function. I have read about a way of doing regex recursively with (?R) or (?0) but I have not had any success using that to highlight functions recursively in gedit.

Here are the tests that I am currently using to determine success.

myFrame.nextFunction = sorter.Sort.;


Ok, looks like I was making this more complicated than it needed to be.

I was able to achieve what I needed with this simpler regex. I just told it to stop looking for the close parenthesis.


Answered By – joelliusp

Answer Checked By – David Goodson (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.