Solved

Find all text within parenthesis

Posted on 2007-11-30
3
575 Views
Last Modified: 2012-06-22
Hi there!,

I want a RegEx to find all text in a opened and closed parenthesis.

note that there may be other parenthesis inside that one.
For example this should match ((int)GetInt((float)3))
however, it should not match with unfinished parenthesis such as ((int) or ((int)GetInt((float)

Thanks in advance,
DK
0
Comment
Question by:dkloeck
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
ddrudik earned 500 total points
ID: 20383128
You didn't mention what OS/lang, but here's a couple links that might help:

.NET:
http://www.codeproject.com/csharp/RegEx_Balanced_Grouping.asp
Perl:
http://math2.org/david/text-balanced/pod.html
0
 
LVL 10

Author Comment

by:dkloeck
ID: 20383344
I need it for use with the Visual studio .net 2005 search with RegEx (WinXP Prof.)
I will use it to search within code
0
 
LVL 27

Expert Comment

by:ddrudik
ID: 20444057
Thanks for the question and the points.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

821 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