Need help with regular expression. I have tried with a cheat sheat but it won’t work.
I am looping through lines from a List and are looking for a match:
mail exchanger = *.domain.com
Where * = everything.
Any help on that?
I have tried with:
\\w[mail exchanger = ].*\\.domain\\.com
– But it also matches on line without the “exchanger” part in it.
Best regards
Why not just use
line.Contains(".domain.com") && line.Contains("mail exchanger = ")? Nice and simple.Your regular expression isn’t working because the
[]‘s say to match any character in them. So it will match anm, ana, ani, and so on… You mean to use()‘s.