RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 184 regular expressions found.

Change page:   |    Displaying page 1 of 10 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$
Description
Domain names: This regular expression tests the validity of a domain or hostname. It will match any valid domain name that does not contain characters which are invalid in URLs, and which ends in .com, .org, .net, .mil, or .edu. You can add additional valid TLDs by appending the | (pipe) character and the desired TLD to the list in the parens.
Matches
3SquareBand.com | asp.net | army.mil
Non-Matches
$SquareBand.com | asp/dot.net | army.military
Author Rating: Not yet rated. G. Andrew Duthie
Title Test Details Pattern Title
Expression
((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+)
Description
Regular Expression matches any internet URLs. Used with the replace method it comes in very handy.
Matches
http://www.aspemporium.com | mailto:dominionx@hotmail.com | ftp://ftp.test.com
Non-Matches
www.aspemporium.com | dominionx@hotmail.com | bloggs
Author Rating: The rating for this expression. Justin Saunders
Title Test Details Pattern Title
Expression
Last.*?(\d+.?\d*)
Description
Plucks the last quote of a Stock from the MSN MoneyCentral WebQuote page for any given stock symbol. The URL of the web page where this RegEx should be applied is: http://localhost/asp/webquote.htm?ipage=qd&Symbol=,give the stock symbol here> You must also use the singleline option.
Matches
<TR><TD ALIGN=RIGHT> </TD><TD>Last</TD><TD ALIGN=RIGHT NOW
Non-Matches
[AADDSS]
Author Rating: Not yet rated. Prasad DV
Title Test Details Pattern Title
Expression
^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$
Description
Verifies URLs. Checks for the leading protocol, a good looking domain (two or three letter TLD; no invalid characters in domain) and a somwhat reasonable file path.
Matches
http://psychopop.org | http://www.edsroom.com/newUser.asp | http://unpleasant.jarrin.net/markov/inde
Non-Matches
ftp://psychopop.org | http://www.edsroom/ | http://un/pleasant.jarrin.net/markov/index.asp
Author Rating: Not yet rated. Klaxon Mindjammer
Title Test Details Pattern Title
Expression
(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?
Description
*CORRECTED: Again thanks for all the comments below. If you want to include internal domain as well change the partial code (\.[\w-_]+)+ to (\.[\w-_]+)? See the comments below* This is the regular expression I use to add links in my email program. It also ignores those suppose-to-be commas/periods/colons at the end of the URL, like this sentence "check out http://www.yahoo.com/." (the period will be ignored) Note that it requires some modification to match ones that dont start with http.
Matches
http://regxlib.com/Default.aspx | http://electronics.cnet.com/electronics/0-6342366-8-8994967-1.html
Non-Matches
www.yahoo.com
Author Rating: The rating for this expression. M H
Title Test Details Pattern Title
Expression
^(?=[^&])(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?
Description
Use it for breaking-down a URI (URL, URN) reference into its main components: Scheme, Authority, Path, Query and Fragment. This is not a simple match regular expression. so it not works to verify a URI. It returns 1 matching group for each URI component. For example, for the following URI: http://regexlib.com/REDetails.aspx?regexp_id=x#Details returns: scheme=&quot;http&quot;, authority=&quot;regexlib.com&quot;, path=&quot;/REDetails.aspx&quot;, query=&quot;regexp_id=x&quot; and fragment=&quot;Details&quot;. This is a W3C raccomandation (RFC 2396).
Matches
http://regexlib.com/REDetails.aspx?regexp_id=x#Details
Non-Matches
&
Author Rating: Not yet rated. Frederico Knabben
Title Test Details Pattern Title
Expression
([A-Z]:\\[^/:\*\?<>\|]+\.\w{2,6})|(\\{2}[^/:\*\?<>\|]+\.\w{2,6})
Description
This regular expression pattern can be used to check the validity of paths for file upload controls. The uploaded file can be either stored locally or accessible through UNC. It cannot contain illegal characters for the windows OS - that may be supported e.g. on Mac OS – and cannot be a URL (Yes, as weird as it may seem, some users enter URLs in the file upload box, even though there is a browse button...)
Matches
C:\temp\this allows spaces\web.config | \\Andromeda\share\file name.123
Non-Matches
tz:\temp\ fi*le?na:m<e>.doc | \\Andromeda\share\filename.a
Author Rating: Not yet rated. Alban Schmid
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*$
Description
Modified URL RegExp that requires (http, https, ftp)://, A nice domain, and a decent file/folder string. Allows : after domain name, and these characters in the file/folder sring (letter, numbers, - . _ ? , ' / \ + &amp; % $ # = ~). Blocks all other special characters-good for protecting against user input!
Matches
http://www.blah.com/~joe | ftp://ftp.blah.co.uk:2828/blah%20blah.gif | https://blah.gov/blah-blah.as
Non-Matches
www.blah.com | http://www.blah&quot;blah.com/I have spaces! | ftp://blah_underscore/[nope]
Author Rating: Not yet rated. Brandon Luhring
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*[^\.\,\)\(\s]$
Description
This Regex (can be used e.g. in PHP with eregi) will match any valid URL. Unlike the other exapmles here, it will NOT match a valid URL ending with a dot or bracket. This is important if you use this regex to find and &quot;activate&quot; Links in an Text
Matches
https://www.restrictd.com/~myhome/
Non-Matches
http://www.krumedia.com. | (http://www.krumedia.com) | http://www.krumedia.com,
Author Rating: Not yet rated. Michael Krutwig
Title Test Details Pattern Title
Expression
((&quot;|')[a-z0-9\/\.\?\=\&amp;]*(\.htm|\.asp|\.php|\.jsp)[a-z0-9\/\.\?\=\&amp;]*(&quot;|'))|(href=*?[a-z0-9\/\.\?\=\&amp;&quot;']*)
Description
Will locate an URL in a webpage. It'll search in 2 ways - first it will try to locate a href=, and then go to the end of the link. If there is nu href=, it will search for the end of the file instead (.asp, .htm and so on), and then take the data between the &quot;xxxxxx&quot; or 'xxxxxx'
Matches
href=&quot;produktsida.asp?kategori2=218&quot; | href=&quot;NuclearTesting.htm&quot;
Non-Matches
U Suck
Author Rating: Not yet rated. Henric Rosvall
Title Test Details Pattern Title
Expression
\b(((\S+)?)(@|mailto\:|(news|(ht|f)tp(s?))\://)\S+)\b
Description
Whilst writing a plain-text to HTML function, I ran into the problem of links that users had written with &amp;lt;a&amp;gt; tags (as opposed to just writing the URL) were linking improperly. This regular expression returns many types of URL, and preceding characters, if any. This allows you to handle each type of match appropriately
Matches
href='http://www.deepart.org' | demogorgon@deepart.org | ftp://123.123.123.123
Non-Matches
www.deepart.org | deepart.org | 123.123.123.123
Author Rating: Not yet rated. Demo Gorgon
Title Test Details Pattern Title
Expression
(mailto\:|(news|(ht|f)tp(s?))\://)(([^[:space:]]+)|([^[:space:]]+)( #([^#]+)#)?)
Description
this is a very little regex for use within a content management software. links within textfields has not to be written in html. the editor of the cms is instructed to use it like this: 1. mention spaces in front and behind the url 2. start url with http://, mailto://, ftp:// ... 3. use optional linktext within #linktext# (separated with single space) 4. if there is no linktext the url/email will show up as linktext 5. avoid url with spaces in filename (use %20 urldecode) replace pattern (space in front): &lt;a href=&quot;\\1\\3\\4&quot; target=&quot;_blank&quot;&gt;\\3\\6&lt;/a&gt;
Matches
http://www.domain.com | http://www.domain.com/index%20page.htm #linktext# | mailto://user@domai
Non-Matches
&lt;a href=&quot;http://www.domain.com&quot;&gt;real html link&lt;/a&gt; | http://www.without_space_
Author Rating: Not yet rated. Martin Schwedes
Title Test Details Pattern Title
Expression
\.com/(\d+)$
Description
This is a regex I wrote to capture requests to AspAlliance.com with an article id as the only thing after the domain. So http://aspalliance.com/123 would go to article number 123. It maps the URL to the actual aspx file that displays the article based on the ID.
Matches
http://aspalliance.com/123 | www.aspalliance.com/123 | http://aspalliance.com/34
Non-Matches
http://aspalliance.com/article.aspx?id=123 | http://aspalliance.com/ | http://aspalliance.com/articl
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
.*?$(?<!\.aspx)
Description
Matches a string to ensure that it does not end with .aspx; sure, you'd probably use string handling to do something this simple but, in the real world you'd whack a regex which validates a valid url to the front of this. The pattern was created by Wayne King; you can read about it here: http://scottwater.com/blog/posts/10204.aspx
Matches
http://weblogs.asp.net/DNeimke/blah.gif
Non-Matches
http://weblogs.asp.net/DNeimke/Default.aspx
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
(?<http>(http:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|[~])*)
Description
This is HTTP Url extractor
Matches
http://www.abc.com | www.mpgrewal.tk
Non-Matches
noida-India | crazy123
Author Rating: The rating for this expression. Manpreet Grewal
Title Test Details Pattern Title
Expression
wsrp_rewrite\?(?&lt;wsrp_uri&gt;[\w%:&amp;\\/;.]*)/wsrp_rewrite
Description
Matches a string used to rewrite urls under the WSRP specification. It captures the URL-Encoded string that represents a url. Url validation is not provided.
Matches
wsrp_rewrite?http%3a%2f%2fregexplib.com%3fid%3d1%26message%3dtest/wsrp_rewrite | wsrp_rewrite?http:/
Non-Matches
http%3a%2f%2fregexplib.com%3fid%3d1%26message%3dtest | http://www.regexplib.com/Add.aspx
Author Rating: Not yet rated. Andres Garcia
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.[a-zA-Z]{2,4})(\:[0-9]+)?(/[^/][a-zA-Z0-9\.\,\?\'\\/\+&amp;%\$#\=~_\-@]*)*$
Description
None of the other URL regex's seemed to work right for me, so i threw this together. works well with PHP's ereg().
Matches
http://www.sysrage.net | https://64.81.85.161/site/file.php?cow=moo's | ftp://user:pass@host.com:123
Non-Matches
sysrage.net
Author Rating: Not yet rated. Brian Bothwell
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+))*$
Description
Ok here's an updated URL regex for you folks. It allows localhost and all TLDs. Feel free to add each country code individually if you want a tighter match.
Matches
http://site.com/dir/file.php?var=moo | https://localhost | ftp://user:pass@site.com:21/file/dir
Non-Matches
site.com | http://site.com/dir//
Author Rating: Not yet rated. Brian Bothwell
Title Test Details Pattern Title
Expression
^http://([a-zA-Z0-9_\-]+)([\.][a-zA-Z0-9_\-]+)+([/][a-zA-Z0-9\~\(\)_\-]*)+([\.][a-zA-Z0-9\(\)_\-]+)*$
Description
A very crude url pattern.
Matches
http://www.jonas.no/~webs(i)der/jon_as.php | http://www.yahoo.com/net//ore
Non-Matches
http://www./no/good | imap://www.com/
Author Rating: Not yet rated. Martin Matusiak
Title Test Details Pattern Title
Expression
^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&amp;%\$#\=~_\-]+))*$
Description
Version 1.3.0: I needed a regexp to validate URL's without the ht(f)tp(s):// and include North American domains (like .us and .ca) and there didn't seem to be one available...so I created one. It will also work with ASP QueryStrings and anchor URL's. If you have a problem with the expression or have any suggestions to improve, please write me and let me know. Added .uk domain and expression now allows for URLs that contain JSP session IDs. 4/14/04 - added ability to include URLs that start with server names.
Matches
www.blah.com:8103 | www.blah.com/blah.asp?sort=ASC | www.blah.com/blah.htm#blah
Non-Matches
www.state.ga | http://www.blah.ru
Author Rating: The rating for this expression. Brad Dobyns
Change page:   |    Displaying page 1 of 10 pages; Items 1 to 20

Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials