Created
June 17, 2013 15:30
-
-
Save vendettamit/5797807 to your computer and use it in GitHub Desktop.
My Regex Collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Testing websites: | |
http://www.regex101.com/r/yM3vL0 | |
http://www.regexplanet.com/advanced/dotnet/index.html | |
UrlSourceOrLocalDriveWithRegex = @"(?i)\b^(https?|s?ftp)+:\/\/[aA-zZ]*[0-9]*|([aA-zZ]{1}:{1}\\{1}\b).*$"; | |
Matches: Https://www.something.com, Ftp://somesource.com, sftp://securesource.com, http://moreurl.com, C:\path etc. | |
Unmatch: httpss://something.com, abcd://, c:, C, | |
SystemDriveOrUNCPathRegex = @"^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*.*))+$" | |
Matches: c:\folder, \\server\folder | |
unmatch: c:, \\ser.vom etc. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment