c# - Use regex to match all groups including own delimiter? -
my matching token string is
> token > so text between > > match.
my string example:
(random text) > (some token) > (some token) > (random text) so sample text
impossible 1 > possible 2 > possible 3 > impossible 4 i need possible matches.
the regex
\>(.*)\> only matches 1 group
possible 2 > possible 3 when need following matches
possible 2 > possible 3 possible 2 possible 3
unless i'm misunderstanding, there doesn't seem need regex here.
string input = "(random text) > (some token) > (some token) > (random text)"; list<string> splitlist = input.split('>').tolist(); //(optional) place original input string @ beginning //like regex group match have splitlist.insert(0, input);
Comments
Post a Comment