Results 1 to 6 of 6
- 08-18-2010, 03:42 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 15
- Rep Power
- 0
Using regex to retrieve all text inside parentheses
Hi. My program will be parsing syntax coming from the user, and certain bits of data will be designated inside parentheses (like a URL or date, for instance).
Since multiple parentheses will probably show up in the syntax, I don't want to settle for finding the index of an opening parenthesis and substringing the rest from there.
Is there any way to accomplish this task in regex?
I want to store each string found between each set of parentheses in a List and parse each string individually.
For example:
String syntax = "foo foo (12-12-10)(http://www.foo.bar)";
List fromParentheses = returnEverythingInsideEachParentheses(syntax);
- 08-18-2010, 06:42 PM #2
Dratted cross poster
Java Programming - Using regex to retrieve all text inside parentheses
db
- 08-18-2010, 06:44 PM #3
- 08-18-2010, 07:57 PM #4
Member
- Join Date
- Aug 2010
- Posts
- 15
- Rep Power
- 0
What the heck? Is this the same forum or something??
- 08-18-2010, 08:03 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
- 08-18-2010, 08:05 PM #6
Member
- Join Date
- Aug 2010
- Posts
- 15
- Rep Power
- 0
Similar Threads
-
Retrieve array inside a list as a Map value
By Ms.Ranjan in forum Advanced JavaReplies: 2Last Post: 08-04-2010, 12:30 PM -
I can't read a text file located inside my jar.
By Serrano0811 in forum New To JavaReplies: 1Last Post: 04-21-2010, 05:03 PM -
Help with Regex to get only <td></td> and the text within it in a <table> tag
By masterrs.mind in forum Advanced JavaReplies: 15Last Post: 03-02-2010, 07:09 PM -
Retrieve values of Text boxes using LIST
By Kayal in forum Web FrameworksReplies: 2Last Post: 03-20-2009, 11:00 AM -
problem aligning both image/text inside a button
By rick_cols in forum SWT / JFaceReplies: 0Last Post: 09-18-2008, 08:20 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks