Two problems with your code:
- You've used
Regex.Match
instead of Regex.IsMatch
; - You've missed the
@
prefix on the second "\b"
string;
I'd also be inclined to add a
Regex.Escape
around the word to find, in case it contains any special characters.
var listTobeDeleted = dtRosterList.AsEnumerable()
.Where(r => falsefields.AsEnumerable()
.Select(f => f.Field<string>("FieldName"))
.Any(fn => Regex.IsMatch(r.Field<string>("ListName"), @"\b" + Regex.Escape(fn) + @"\b", RegexOptions.IgnoreCase)))
.CopyToDataTable();