Regex:
(?<lang2>this\s*is\s*a\s*test\s*string)|(?<lang1>test)
Sample text:
this is a test string
If you run those named capturing groups individually the results in a match group with value. But if you run it combine like written above, then it return 1 group instead of two. I need to capture both groups. So the out put groups should be like:
Matched Group 1: "this is a test string"
Matched Group 2: "test"