c# - Regex validation and retrieval -
i have regex string in c# like:
ove.com: purchase confirmation \([0-9a-za-z\s\.]+ [0-9a-za-z]{17} peddle llc\)
now, want retrieve value formed [0-9a-za-z]{17}
in regex.
how can that?
so want select part of regex after matched. can add parentheses around part.
int indexval = 0; regex re = new regex(@"([0-9a-za-z\s.]+ ([0-9a-za-z]{17}) peddle llc)") match m = re.match(s) if(m.success) { indexval = int.tryparse(m.groups[1].tostring()); }
group index might wrong, don't kill me. copied code here: how retrieve selected text using regex in c#?
Comments
Post a Comment