Find all substrings between two strings

Posted by Orsol on Stack Overflow See other posts from Stack Overflow or by Orsol
Published on 2010-03-30T20:14:56Z Indexed on 2010/03/30 20:23 UTC
Read the original article Hit count: 163

Filed under:
|

I need to get all substrings from string.
For ex:

StringParser.GetSubstrings("[start]aaaaaa[end] wwwww [start]cccccc[end]", "[start]", "[end]");

that returns 2 string "aaaaaa" and "cccccc" Suppose we have only one level of nesting. Not sure about regexp, but I think it will be userful.

© Stack Overflow or respective owner

Related posts about regex

Related posts about c#