Use more than 1 regexoptions for Regex.Match

Hi guys I want to use more than 1 regexoptions in assing. for example I want to get name in text.
name= Regex.Match( text,"(?<=name:).*(\s)",regexoptions.Multiline).Value.Replace(":","").Trim but also I want to add regexoptions.IgnoreCase. But I can’t.
Please help

@murat.karasoy - Could you please try this…

3 Likes

thank you

  1. Regex.Match( text,"(?<=name:).*(\s)",regexoptions.Multiline and regexoptions.IgnoreCase)

  2. Regex.Match(text,"(?mi)(?<=name:).*(\s)")

(?m) => MultiLine
(?i) => IgnoreCase

try it.

1 Like

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