RegEx trouble - need help matching a string

Apr 24 2006 6:15 PM
Hi there, I am passing a selected area of text as a string (from an IDE text editor) and attempting to match it against a textfile using the following regex : Regex targetExpOld = new Regex(@"^\s+"+content+ @"\s+$", RegexOptions.Multiline); if content = "int i = 6;" i get a match however if content contains a "." or a "(" it doesnt find a match any idea how i can dodge this - i realise its a problem with special characters but I'm new to regex and dont have time to become an expert!(just yet) kind regards Tom

Answers (1)