I have a regex where
%word% can occur multiple times, separated by a "<"
%word% is defined as ".*?"|[a-zA-Z]+
so i wrote
(".*"|[a-zA-Z]+)([<](".*"|[a-zA-Z]+))*
Is there any way i can shrink it using capturing groups?
(".*"|[a-zA-Z]+)([<]\1)*,
But i don't think \1
can be used as it'd mean repeat the first capture, as i would not know what was captured as it can be a quoted string or a word.
Any thing similar i can use to refer matching the previously written group. I'm working in C#.