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

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -