I have read that to match a word inside of a string using Regular expressions (in .NET), I can use the word boundary specifier (\b
) within the regex. However, none of these calls result in any matches
Regex.Match("INSERT INTO TEST(Col1,Col2) VALUES(@p1,@p2)", @"\b@p1\b");
Regex.Match("INSERT INTO TEST(Col1,Col2) VALUES(@p1,@p2)", @"\bINSERT\b");
Is there anything I am doing wrong ?
EDIT: The second one is already working ;)