I have a large String and I need to extract String value from it. String value is located between delimiters
category = '
and
';
This is my regex, but I need to avoid outputing delimiters.
String productCategory = Regex.Match(html, @"category = '(.*?)';").Value;
This is the exampe
category = 'Video Cards';
and I need to extract
Video Cards
What you can use is the lookahead and lookbehind operators, so you end up with something like:
It’s also worth mentioning that parsing HTML with regexes is a bad idea. You should use an HTML parser to parse HTML.