Solved

Regex - Find between quotes and right of (

Posted on 2009-07-10
8
699 Views
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

Thanks
0
Comment
Question by:keschuster
[X]
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
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24826967
"[^"]*"


\(.*



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

Expert Comment

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

("[^"]*")
 
 
(\(.*)

Open in new window

0
 

Author Comment

by:keschuster
ID: 24827035
how would you escape "[^"]*" in VBA
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:keschuster
ID: 24827043
what is capturing?  Example?
0
 
LVL 40

Expert Comment

by:mrjoltcola
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.

http://www.regular-expressions.info/dotnet.html
0
 

Author Comment

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

Thanks!!
0
 
LVL 40

Expert Comment

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

Good luck.
0
 
LVL 58

Expert Comment

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

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

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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…

628 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