Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3622700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:17:34+00:00 2026-05-18T23:17:34+00:00

I have a regex which I’m using to match user functions inside an IDE

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:17:35+00:00Added an answer on May 18, 2026 at 11:17 pm

    Unfortunately, you cannot really use regex to parse any context-free grammar, but hopefully this can do better. It uses positive lookahead to not include the opening paren in the match but look for it anyways:

    (?:[^\._])?([\w-]+)(?=[\(])
    

    If your IDE’s regex engine supports negative lookbehind (the subexpression is not found before the match), you can avoid matching the string ‘function’ or “function”:

    (?!<['"])(?:[^\._])?([\w-]+)(?=[\(])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this regex thanks to another wonderful StackOverflow user /(?:-\d+)*/g I want it
I have a Regex which contains the following .Is this suitable restricting the user
I have a regex which will match the string 'test', but I want it
I have an ASP website which I need to add a RegEx match to.
^(.)+\S{10}(.)+$ I have that regex which will match any string that contains a word
Here is an easy one :) on REGEX I have this regex ^\\$?(\\d{1,3},?(\\d{3},?)*\\d{3}(\\.\\d{2})?|\\d{1,3}(\\.\\d{2})?|\\.\\d{2}?)$ which
I have regex which reads: @<img\s*[^>]*>(?:\s*?</img>)? Can someone please explain this part: (?:\s*?)? What
I want to get a regex which will match a tag in a java
I have the following regex which suppose to match email addresses: [a-z0-9!#$%&'*+\\-/=?^_`{|}~][a-z0-9!#$%&'*+\\-/=?^_`{|}~.]{0,63}@[a-z0-9][a-z0-9\\-]*[a-z0-9](\\.[a-z0-9][a-z0-9\\-]*[a-z0-9])+$. I have
I have a regex which validates the user in entering a number with only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.