Hi guys,
I'm having a bit of a RegEx problem, and I was hoping you could help.
I have the following code
I'm trying to get the data out of the brackets in a string that looks like this:
1/4" (.250") - 11/32" (.344")
But what I'm getting is this:
(.250") - 11/32" (.344")
I remember, when first learning about regular expressions in Perl, lo many years ago, there was a way to make the expression "Not Greedy," and only go to the first instance of the character, not the last one.
Can anyone help me out?
-------------------------
Call me barely Impressive Captain.
I'm having a bit of a RegEx problem, and I was hoping you could help.
I have the following code
Code:
ArrayList strArray = new ArrayList();
string strPattern = @"\(.*\)";
foreach (Match m in Regex.Matches(str, strPattern))
strArray.Add(m.ToString());
I'm trying to get the data out of the brackets in a string that looks like this:
1/4" (.250") - 11/32" (.344")
But what I'm getting is this:
(.250") - 11/32" (.344")
I remember, when first learning about regular expressions in Perl, lo many years ago, there was a way to make the expression "Not Greedy," and only go to the first instance of the character, not the last one.
Can anyone help me out?
-------------------------
Call me barely Impressive Captain.