Find a text substring between two strings (RegExp)

Hello.
There is a string of text
asd2qwd2er234568678234111
How to apply d2*234 through RegExp to get “d2er234” and not “d2qwd2er234”?

This “d2.+?234” produces “d2qwd2er234”, how to limit the last occurrence of d2? Something like “(d2)(not(d2)).+?234

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match("asd2qwd2e234568678234111","d2(?!.*d2).*?234").Value

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.