S
siddharthkhare
Hi All,
I want to capture a word which is in certain range from another word
only if a third word is not between them(anywhere in the range).
Regex r = new
Regex(@"(FirstWord.{1,25})*((?<!ThirdWord\s+)SecondWord)");
So it works fine for a string like this
FirstWord ThirdWord SecondWord
it works fine in this case and does not return me a match.
but lets say string is of this form
FirstWord ThirdWord SometingElse here SecondWord
than returns me a match .I wan it to not return me anything if there is
a "ThirdWord" any where in the that range.
Irrespective if it is just before "SecondWord" or any where else in
that range.
Thanks
KS
I want to capture a word which is in certain range from another word
only if a third word is not between them(anywhere in the range).
Regex r = new
Regex(@"(FirstWord.{1,25})*((?<!ThirdWord\s+)SecondWord)");
So it works fine for a string like this
FirstWord ThirdWord SecondWord
it works fine in this case and does not return me a match.
but lets say string is of this form
FirstWord ThirdWord SometingElse here SecondWord
than returns me a match .I wan it to not return me anything if there is
a "ThirdWord" any where in the that range.
Irrespective if it is just before "SecondWord" or any where else in
that range.
Thanks
KS