I have a large regular expression and I've turned on IgnorePatternWhitespace so I can make it more readable. My problem is that I want to match a literal space character. What's the best way to do that?
An example:
Regex myRegex = new Regex(@"
(?> <table[^>]*> ) # Find a table
(?> .*?<tr> ) # Find the first row
(?> .*?<th> ) # Find the first header column
My phrase # Look for our key phrase
etc.
", RegexOptions.IgnorePatternWhitespace);
In the above example, "My phrase" should include a space.
Use "\s" or "[ ]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With