Answer by Andrei15193 for C# regEx expression not matching newline
Try Regex.IsMatch(input, @"\s*http://go\S*\.microsoft.com/fwlink\S*\s*", RegexOptions.Multiline). This will match any line that contains only your url surrounded by any number of white space...
View ArticleAnswer by Eder for C# regEx expression not matching newline
Probably your string is just ending with Line Feed aka "\n" instead of the Carriage Return Line Feed aka "\r\n", maybe you can try this \r?\n at the end of your regular expression.Also, you can use $...
View ArticleAnswer by I4V for C# regEx expression not matching newline
string pattern = "http://go.*?.microsoft.com/fwlink.*?$";var urls = Regex.Matches(text, pattern,RegexOptions.Multiline) .Cast<Match>() .Select(m => m.Value.Trim()) .ToList();
View ArticleAnswer by Derek for C# regEx expression not matching newline
Maybe you need a blank line (hit Enter) at the end of your file? Does your file actually end in \r\n?
View ArticleAnswer by King King for C# regEx expression not matching newline
Try this://note the @ at the beginningstring pattern = @"http://go.*?.microsoft.com/fwlink.*?[\r\n]";
View ArticleC# regEx expression not matching newline
This is my file test1.txtLine 4: http://go34.microsoft.com/fwlink/p/?LinkId=333333 Line 4: http://go/p.microsoft.com/fwlink/p/?LinkId=333333I want to write a regex expression that match's the 2 URLs...
View Article