Quantcast
Channel: C# regEx expression not matching newline - Stack Overflow
Browsing latest articles
Browse All 6 View Live

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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


C# 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
Browsing latest articles
Browse All 6 View Live


Latest Images