Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (word1).*?(word2)
- //use '*' or '*?' depending on what you want for "word1 aaa word2 bbb word2"
- string pattern = "word1(.*)word2";
- var m = Regex.Match(text1, pattern, RegexOptions.Singleline);
- Console.WriteLine(m.Groups[1]); // the result
Add Comment
Please, Sign In to add comment