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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 5
Title Test Details ISBN 10 or 13
Expression
^(97(8|9))?\d{9}(\d|X)$
Description
Validates both ISBN 10 and ISBN 13 numbers, and confirms ISBN 13 numbers start with only 978 or 979.
Matches
0672317249 | 9780672317248
Non-Matches
0-672-31724-9 | 5555555555555
Author Rating: The rating for this expression. Michael Fienen
Title Test Details Filter Other Domain Names
Expression
https?://(?!\S*?domainname\.tld/)\S*?/
Description
This type of filter can be used if you're trying to get rid of results from a report or something not originating from a given domain of the format domainname.tld. Anything matching the pattern can then be excluded, deleted, etc. (Like with a Google Mini, GSA, or site auditing software)
Matches
http://www.domainname2.tld2/ | http://sub.domainname3.tld3/ | https://secure.domainname4.tld4/ | http://domainname5.tld5/
Non-Matches
http://www.domainname.tld/ | http://sub.domainname.tld/ | https://secure.domainname.tld/ | http://domainname.tld/
Author Rating: Not yet rated. Michael Fienen
Title Test Details First and Last Name
Expression
^([A-Z][a-z]+)\s([A-Z][a-zA-Z-]+)$
Description
The pattern matches what would at least appear to be a first and last name, with an optional hyphenated last name. There is an obvious flaw that it can't distinguish between actual names and any two words that start with capital letters as noted in the matching text. Also, two part first names like "Mary Jo" can cause problems.
Matches
John Smith | Jane Smith-Doe | John McSmith | Abc Xyz
Non-Matches
john smith | J Smith | Mrs. Doe
Author Rating: Not yet rated. Michael Fienen
Title Test Details Multisided dice
Expression
([1-9]{1,2})?(d|D)([1-9]{1,3})((\+|-)([1-9]{1,3}))?
Description
For the geeks out there, you can use this to break down die rolls of multisided dice for things like role playing games. Includes support for a die multiplier and an end modifier value. Supports a multiplier up to 99, and sides and a modifier of up to 999.
Matches
d12 | 2d4 | 3D8-2 | 99D999+999
Non-Matches
0d6 | 100d4 | 2a4 | 3D8*3
Author Rating: The rating for this expression. Michael Fienen
Title Test Details Hex Color Codes
Expression
^\#?[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?$
Description
Matches valid 3 or 6 character hex codes used for HTML or CSS.
Matches
fff | #990000 | #cc3366 | #AAAAAA
Non-Matches
#5555 | #ZJK000 | CDCDCDCD
Author Rating: Not yet rated. Michael Fienen
   Displaying page 1 of 1 pages; Items 1 to 5

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