I am trying to match on a string that begins with ./media
I have the following Regular expression:
bool match = Regex.IsMatch(@"^\./media", imgSourcePath);
My source string looks like: ./media/somefile.png
When I test this expression in other tools it works as expected. However a match is never found in C# source implementation. Can someone tell me why?
Thanks!
Your parameters appear to be backwards:
Regex.IsMatch(String input, String pattern). Try this: