c# - Extract all patterns using Regex -
i'm implementing pattern extraction particular string. pattern should start column( (which means particular column in excel data input) or cell( (which means particular cell in excel data input).
- input string = "column(f)/100 + cell(b,2)/10"
- expected output: column(f), cell(b,2).
source code:
list<string> result = new list<string>(); regex patternparser = new regex(@"(?:column\()\s+\).+?|(?:cell\()\s+\).+?", regexoptions.compiled | regexoptions.ignorecase); foreach (match m in patternparser.matches(vareval)) { result.add(m.value); }
i got result: column(f)/ , cell(b,2)/.
Comments
Post a Comment