How is this regex wrong?
- by Spot
I have a regex which I'm using to match user functions inside an IDE (Sublime). This matches what I want (the function name itself), but it also matches the first parentheses. Therefore the match is like follows:
this._myFunction('content');
Notice the opening paran.
Here is my expression:
(?:[^\._])?([\w-]+)(?:[\(]){1}
How can I exclude the opening paran from getting matched?
.
As a bonus question: How can I successfully not match the string: function, because as you can expect function( matches (not fun in JS).
Thank you to anyone who can assist.