pabloflinstone pabloflinstone - 1 year ago 91
C# Question

How i can get the first match in regex and import this match in a string?

For example using a regex expression del(.*?)del get delcatdel
and save the result in string or in text


in my text (or string) i need obtain delcatdel

USING c sharp

please anybody help me

Answer Source
var regex = new Regex("del(.*?)del");
var match = regex.Match("word1word2delcatdelword3word4deldogdelword5");
string matched = match.Value;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download