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: 8096 regular expressions found.

Change page:   |    Displaying page 388 of 405 pages; Items 7741 to 7760
Title Test Details 1 to 99 in .5 increments
Expression
^[1-9]{1,2}(.5)?$
Description
This is a simple regular expression which allows 1 to 99 in .5 increments which I originally developed for a forum post
Matches
1.5 | 99.5 | 35.5 | 43 | 64 | 24
Non-Matches
.5 | 100 | 0 | 0.5 | 34.3 | 24.356 | 36.55
Author Rating: Not yet rated. Matthew Harris
Title Test Details Active Directory User@Domain Format
Expression
^(?<user>.+)@(?<domain>.+)$
Description
This uses named groups to extract the user and domain portions of an Active Directory user in user@domain format. You can use the following c# code to convert this into domain\user format: public string ConvertUserAtDomainToDomainUser(string userAtDomain) { return Regex.Replace(userAtDomain, @"^(?<user>.+)@(?<domain>.+)$", @"${domain}\${user}"); } This regex is intended to provide extraction from valid user@domain strings rather than validate its format.
Matches
bill@microsoft | peter.gibbons@initech | blackbeard@jollyroger
Non-Matches
bil+microsoft | microsoft\bill
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Bank Sort Code
Expression
^(\d){2}-(\d){2}-(\d){2}$
Description
Validates the format of a UK bank sort code.
Matches
20-40-36 | 50-25-48 | 45-85-66
Non-Matches
204036 | 2564584 | 444-58-54 | 45/45/85
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Bank Account (8 Digits)
Expression
^(\d){8}$
Description
UK Bank account numbers are 8 digits. One bank uses 7 digits so in the validation error message you should instruct the user to prefix with a zero of their code is too short. If you want to allow the 7 digit codes as well use this regex: http://regexlib.com/REDetails.aspx?regexp_id=2707
Matches
08464524 | 45832484 | 24899544
Non-Matches
1234567 | 1 5 2226 44 | 123456789
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Bank Account (7-8 Digits)
Expression
^(\d){7,8}$
Description
UK Bank Account. One bank account issues 7 digit bank codes and you should prefix a 0 yourself after input. If you want strict validation of 8 characters use this regex: http://regexlib.com/REDetails.aspx?regexp_id=2706
Matches
1234567 | 12345678
Non-Matches
123456 | 123 4567 | 123456789
Author Rating: Not yet rated. Matthew Harris
Title Test Details No Whitespace
Expression
^[^\s]+$
Description
No whitespace is allowed in a string
Matches
nowhitespace | onewordonly | anotherexample
Non-Matches
two words | three words here | anything with spaces
Author Rating: Not yet rated. Matthew Harris
Title Test Details Clean Domain Name
Expression
^http\://www.[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}/$
Description
This regex only matches clean domain names. No path after. Ends in a forward slash. Starts with http://www. It is pretty slack on the TLD requiring a 2 or 3 letter ending. This part could be tightened up if you wanted to be restrict it to specific TLDs.
Matches
http://www.somedomain.co.uk/ | http://www.somedomain.com/ | http://www.dodgydomain.com.com/
Non-Matches
http://www.somedomain.co.uk/withpath.aspx | http://somedomainwithoutwww.co.uk | http://www.com/ | www.noprotocolprefix.com/ | https://www.secureprotocolprefix.com/ | http://www.notrailingslash.co.uk | HTTP://WWW.beginswithcaps.com/
Author Rating: The rating for this expression. Matthew Harris
Title Test Details UK Phone Number in 4-3-4 Format
Expression
^[\d]{4}[-\s]{1}[\d]{3}[-\s]{1}[\d]{4}$
Description
Allows dashes or spaces to separate.
Matches
0800 333 4444 | 0870-333-4444 | 0844 333-4444
Non-Matches
08003334444 | 0800=333=4444 | 0800 333 4444
Author Rating: The rating for this expression. Matthew Harris
Title Test Details UK Phone Number in 5-3-3 Format
Expression
^[\d]{5}[-\s]{1}[\d]{3}[-\s]{1}[\d]{3}$
Description
Allows dashes or spaces to separate.
Matches
08000 333 333 | 08700-333-333 | 08440 333-333
Non-Matches
08000333333 | 08000=333=333 | 08000 333 333
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-2-2-2 Format
Expression
^[\d]{5}[-\s]{1}[\d]{2}[-\s]{1}[\d]{2}[-\s]{1}[\d]{2}$
Description
Allows dashes or spaces to separate.
Matches
08000 22 22 22 | 08700-22-22-22 | 08440 22-22-22
Non-Matches
08000222222 | 08000=22=22=22 | 08000 22 22 22
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-4-2 Format
Expression
^[\d]{5}[-\s]{1}[\d]{4}[-\s]{1}[\d]{2}$
Description
Allows dashes or spaces to separate.
Matches
0800 4444 22 | 0870-4444-22 | 0844 4444-22
Non-Matches
0800444422 | 0800=4444=22 | 0800 4444 22
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-2-4 Format
Expression
^[\d]{5}[-\s]{1}[\d]{2}[-\s]{1}[\d]{4}$
Description
Allows dashes or spaces to separate.
Matches
0800 22 4444 | 0870-22-4444 | 0844 22-4444
Non-Matches
0800224444 | 0800=22=4444 | 0800 22 4444
Author Rating: Not yet rated. Matthew Harris
Title Test Details Up to 15 digits followed by 0,1 or 2 floating points
Expression
^[0-9]{1,15}(\.([0-9]{1,2}))?$
Description
This might seem like a contrived example but it was written to answer a question on a forum. For regex newbies you can just change the numbers in {} to change the number of required digits to suit your requirements
Matches
1 | 123456789012345 | 123456789012345.1 | 123456789012345.12 | 123456.12
Non-Matches
.12 | 12345.123 | 1234567890123456
Author Rating: The rating for this expression. Matthew Harris
Title Test Details UK Postcode District
Expression
([A-PR-UWYZa-pr-uwyz]([0-9]{1,2}|([A-HK-Ya-hk-y][0-9]|[A-HK-Ya-hk-y][0-9]([0-9]|[ABEHMNPRV-Yabehmnprv-y]))|[0-9][A-HJKS-UWa-hjks-uw]))
Description
Matches the first part of a UK Postcode (known as a postcode district). Case insensitive. Doesnt match: GIR # the postcode for the formerly Post Office-owned Girobank is GIR 0AA. SAN # the postcode for correctly addressed letters to Father Christmas is SAN TA1
Matches
LN5 | SW1 | ln5
Non-Matches
ln5 7nq | GIR | SAN
Author Rating: Not yet rated. Matthew Harris
Title Test Details Skype Name
Expression
^[a-z][a-z0-9\.,\-_]{5,31}$
Description
Validate for Skype Name: must be between 6-32 characters, start with a letter and contain only letters and numbers (no spaces or special characters).
Matches
ASd_RT45326FR
Non-Matches
ASd_@#$*&(
Author Rating: Not yet rated. Avi Azran
Title Test Details URI with Scheme, Path, Query, and Fragment
Expression
(?m)^(?<scheme>\w+?://)?(?<path>(?:[\w.%$\-_+!*'(),=@]+\/|\b)+(?:[\w.%$\-_+!*'(),=@]*))(?<query>\?(?:[\w.%$\-_+!*'(),=@]+=[\w.%$\-_+!*'(),=@]*&?)*)?(?<fragment>#[\w\.%$\-_+!*'(),=@]*)?
Description
Identifies scheme, path, query, and fragment in any URI, putting them into named groups. All groups are optional except path.
Matches
http://regexlib.com/
Non-Matches
~~~~
Author Rating: Not yet rated. Kevin Spencer
Title Test Details TR Content
Expression
(?s)<tr[^>]*>(?<content>.*?)</tr>
Description
Matches complete table rows (<tr>...</tr>) and puts everything between the tr tags into a group named "content".
Matches
<tr><td>abc</td></tr>
Non-Matches
<tr><td>abc</td>
Author Rating: Not yet rated. Kevin Spencer
Title Test Details Query String Parameters
Expression
[\?&](?<name>[^&=]+)=(?<value>[^&=]+)
Description
Matches name/value pairs in HTTP Query Strings, placing name into group named "name" and value into group named "value"
Matches
http://regexlib.com/?a=b&c=d
Non-Matches
http://regexlib.com/
Author Rating: Not yet rated. Kevin Spencer
Title Test Details METAR Report
Expression
(?i)^(?:(?:METAR|SPECI)\s*)*(?<ICAO>[\w]{4})\s*?(?<DateUTC>(?<DayOfMonth>\d{0,2})(?<Hour>\d{2})(?<Minutes>\d{2}))Z{1}\s*(?:[^\r\n])*
Description
Matches any legitimate METAR (Meterological Weather Report) string, and places parts into named groups, "ICAO", "DateUTC", "DayOfMonth", "Hour", "Minutes"
Matches
METAR KORF 310951Z 21004KT 10SM CLR 17/16 A3018
Non-Matches
310951Z 21004KT 10SM CLR 17/16 A3018
Author Rating: Not yet rated. Kevin Spencer
Title Test Details HTML href
Expression
(?i)(?s)<a[^>]+?href="?(?<url>[^"]+)"?>(?<innerHtml>.+?)</a\s*>
Description
Matches a complete HTML href tag, placing the URL into a group named "url" and the innerHTML into a group named "innerHtml"
Matches
<a href="http://regexplib.com">Inner <span>html</span></a>
Non-Matches
<a href="http://regexplib.com">
Author Rating: The rating for this expression. Kevin Spencer
Change page:   |    Displaying page 388 of 405 pages; Items 7741 to 7760

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