Guest User

Untitled

a guest
Jan 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. (word1).*?(word2)
  2.  
  3. //use '*' or '*?' depending on what you want for "word1 aaa word2 bbb word2"
  4. string pattern = "word1(.*)word2";
  5. var m = Regex.Match(text1, pattern, RegexOptions.Singleline);
  6. Console.WriteLine(m.Groups[1]); // the result
Add Comment
Please, Sign In to add comment