Started by Mr. Analog, March 12, 2015, 03:31:35 PM
"BLAH" CMD "OTHER BLAH"
"this" AND "this and that"
value1 AND value2 AND value3
value1 AND value2
Quote from: Lazybones on March 12, 2015, 05:32:10 PMSo do you want a single regex that repeatedly matches quoted values?Do you want a regex that uses groups and returns groups of the values ?I am a little confused still on how the code will use the regex.
Quote from: Thorin on March 12, 2015, 05:42:04 PMHOLY CRAP I KNOW THE ANSWER TO THIS. What you want is non-capturing groups. Non-capturing groups are indicated with a questionmark followed by a colon. So the group is indicated with parentheses, then you put the questionmark and colon at the start of the group (inside the parentheses). Here's the regex for the selection you're trying to make:Code Select Expand(?:^|")([^"]*)(?:$|")
Quote from: Thorin on March 12, 2015, 05:49:43 PMAlso, if you're doing this in .NET and trying to parse a string of operands and operators, and the operators are outside the quotation marks and the operands are inside the quotation marks, why not just split the string into an array, using the quotation marks as your splitter?"this" AND "this and that"would result in an array like so:0: <string.empty>1: this2: AND 3: this and that4: <string.empty>If there was a quotation mark at the start of your string, drop the first array item. If there was a quotation mark at the end of your string, drop the last array item. Or even easier, remove the first and last characters if they're quotation marks, then do your split.
Quote from: Mr. Analog on March 12, 2015, 06:22:18 PMNice, this'll come in handy
Page created in 0.049 seconds with 22 queries.