How to match the string “Net Amount” (between Net and Amount there can be any number of spaces, including zero) with net amount?
Spaces between these two words can be any whitespace and exact matching of two string should be there. But Net Amount (first string with spaces) can be part of any string like Rate Net Amount or Rate CommissionNet Amount.
The match should be case-insensitive.
If you just want to check if a match exists, use IsMatch:
Update: In your comments it sounds like the string you want to search for is only known at runtime. You could try building the regular expression dynamically, for example something like this: