Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Regex - Find between quotes and right of (

Posted on 2009-07-10
Medium Priority
Last Modified: 2012-05-07
what would the regex exp be for

1. Find text between AND INCLUDING quotes.  Ex:  The "big" Bear return "big" including quotes

2. Find the first "(" and everything after it  EX: The (big bear) returns (big bear) or The (big bear returns (big bear

Question by:keschuster
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 40

Accepted Solution

mrjoltcola earned 2000 total points
ID: 24826967


You may have to escape the quotes depending on your API
LVL 40

Expert Comment

ID: 24826979
And if using capturing, then enclose both patterns in ()


Open in new window


Author Comment

ID: 24827035
how would you escape "[^"]*" in VBA
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 24827043
what is capturing?  Example?
LVL 40

Expert Comment

ID: 24827092
Not sure in VBA, in C# or most others we would use backslash to put it inside a regex string

regexstr = "\"[^\"]*\""

capturing is so you can use the match api to retrieve only the portion of the regex that matches the pattern, which is often what you want. So for example, in a regex with multiple () groups, these would correlate to $1, $2, $3, or in .NET terms is MatchObj.Groups(1), MatchObj.Groups(2). etc.

Author Comment

ID: 24827109
pattern = Chr(34) + "[^" + Chr(34) + "]*" did it.

LVL 40

Expert Comment

ID: 24827118
Great. Read that link I provided, it has some .NET VBA samples.

Good luck.
LVL 58

Expert Comment

ID: 24827123
>>how would you escape "[^"]*" in VBA

oRegExp.Pattern =  """[^""]*"""

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question