You don’t need a regex for URLs, use System.Uri
class for this. E.g. by using Uri.IsWellFormedUriString
method for this:
bool isUri = Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute);
More Related Contents:
- Regex to match all us phone number formats
- SqlConnection.Open throwing exception C#
- c# when pressing a button add totals together [closed]
- What are the correct version numbers for C#?
- How do I remove all non alphanumeric characters from a string except dash?
- Type or namespace name does not exist [closed]
- Regular expression to check if password is “8 characters including 1 uppercase letter, 1 special character, alphanumeric characters”
- How to enable C# 6.0 feature in Visual Studio 2013?
- What is the best way to dump entire objects to a log in C#?
- Find a string between 2 known values
- How to keep the delimiters of Regex.Split?
- How to find multiple occurrences with regex groups?
- How do you find all implementations of an interface?
- How to run unit tests (MSTest) in parallel?
- Getting overlapping regex matches in C#
- Regex: C# extract text within double quotes
- .Net regex matching $ with the end of the string and not of line, even with multiline enabled
- How do I filter all HTML tags except a certain whitelist?
- Regex word boundary expressions
- Additional Setup in Visual Studio Installer Projects
- Non-nullable property must contain a non-null value when exiting constructor. Consider declaring the property as nullable
- Canadian postal code validation
- Regex to match a word with + (plus) signs
- Is there a format code shortcut for Visual Studio?
- Visual Studio C# statement collapsing
- The OutputPath property is not set for this project
- c# regex matches example
- How to programmatically include a file in my project?
- VS2010 – How to automatically stop compile on first compile error
- How to extract decimal number from string in C#