173 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^07([\d]{3})[(\D\s)]?[\d]{3}[(\D\s)]?[\d]{3}$ |
Description |
UK Mobile phone regular expression.
I usually run this against a telephone field to split out landlines and mobile numbers. |
Matches |
07976444333 | 07956-514333 | 07988-321-213 |
Non-Matches |
+44 07976444333 | 08956-444-444 |
Author |
Rating:
Daren Salter
|
Title |
Test
Details
Pattern Title
|
Expression |
<script[^>]*>[\w|\t|\r|\W]*</script> |
Description |
this pattern can find all lines of script in HTML code from open to close tag range |
Matches |
<script language=javascript>document.write("one");</script> |
Non-Matches |
-- |
Author |
Rating:
Bassel Issa
|
Title |
Test
Details
US ZIP (5 or 5+4)
|
Expression |
^\d{5}$|^\d{5}-\d{4}$ |
Description |
This regular expression will match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. Other than that, this is just a really really long description of a regular expression that I'm using to test how my front page will look in the case where very long expression descriptions are used. |
Matches |
55555-5555 | 34564-3342 | 90210 |
Non-Matches |
434454444 | 645-32-2345 | abc |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).{4,8}$ |
Description |
Password expresion that requires one lower case letter, one upper case letter, one digit, 6-13 length, and no spaces. This is merely an extension of a previously posted expression by Steven Smith ( [email protected]) . The no spaces is new. |
Matches |
1agdA*$# | 1agdA*$# | 1agdA*$# |
Non-Matches |
wyrn%@*&$# f | mbndkfh782 | BNfhjdhfjd&*)%#$) |
Author |
Rating:
Jeremy Samuel
|
Title |
Test
Details
ZIP+4 - XXXXX-XXXX
|
Expression |
^\d{5}-\d{4}$ |
Description |
Numeric and hyphen 5+4 ZIP code match for ZIP+4. |
Matches |
22222-3333 | 34545-2367 | 56334-2343 |
Non-Matches |
123456789 | A3B 4C5 | 55335 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
\(([0-9]{2}|0{1}((x|[0-9]){2}[0-9]{2}))\)\s*[0-9]{3,4}[- ]*[0-9]{4} |
Description |
Match diferent styles for brazilian Phone number code.
Only DDD (12), complete DDD (012), complete DDD + Telephony Company (0xx12) plus 3 or 4 digits (city code) plus 4 digits (phone number). |
Matches |
(12) 123 1234 | (01512) 123 1234 | (0xx12) 1234 1234 |
Non-Matches |
12 123 1234 | (012) 123/1234 | (012) 123 12345 |
Author |
Rating:
Samuel Mota
|
Title |
Test
Details
Pattern Title
|
Expression |
^[^#]([^ ]+ ){6}[^ ]+$ |
Description |
We've come across the situation where we had to extract the IIS-Log entries without the header information. The data is far more complex than the sample given.
Explanation:
^[^#] = lines not beginnin with #
([^ ]+ ){6} = 6 times no space until one space
[^ ]+ = no spaces allowed...
$ = ...until end of line
For further explanation don't hesitate to write E-Mail. |
Matches |
1111 2222 33 44444 55 6 7777 |
Non-Matches |
#IIS Logfile header |
Author |
Rating:
Not yet rated.
Volker Roth
|
Title |
Test
Details
Pattern Title
|
Expression |
^\s*(((\d*\.?\d*[0-9]+\d*)|([0-9]+\d*\.\d*) )\s*[xX]\s*){2}((\d*\.?\d*[0-9]+\d*)|([0-9]+\d*\.\d*))\s*$ |
Description |
This validates Length times Width times Height measurements, which consists of 3 whole or decimal numbers separated by an x. |
Matches |
1.1 x 4.35 x 5.0 | 1 x 2 x 3 | 4.75 x 300.25 x 0 |
Non-Matches |
z.56 x 6 x 7 | 1 xx 2 x 3 | 1 by 2 by 3 |
Author |
Rating:
Not yet rated.
Rod Early
|
Title |
Test
Details
Pattern Title
|
Expression |
^[AaWaKkNn][a-zA-Z]?[0-9][a-zA-Z]{1,3}$ |
Description |
Simple match for U.S. Amateur Radio Call signs
Must start with an A,K,N or W.
1 or two prefix letters (not case sensitive),
Exactly one zone digit,
One to three suffix digits( not case sensitive).
73
|
Matches |
kd6dun | W9OXZ | kb8ae |
Non-Matches |
kdd90bz | de7bgw | WV7BXQ5 |
Author |
Rating:
Not yet rated.
David Tersigni
|
Title |
Test
Details
Pattern Title
|
Expression |
^[\u0081-\uFFFF]{1,}$ |
Description |
Double byte charactors validator.
The rule applies to double byte charactor input validation. |
Matches |
??? | ???? |
Non-Matches |
ABC | ;&#F; |
Author |
Rating:
Not yet rated.
Max Lu
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\..*)(\..+)?$)[^\x00-\x1f\\?*:\";|/]+$ |
Description |
Checks for a valid windows file name (Must be used with the case-insensitive option
Checks that the file has at lease one char, does not contain any invalid characters and does not have a reserved word as a file name.
"If you see a &quot; in the regex replace it with a " character" |
Matches |
test.txt | test.jpg.txt | a&b c.bmp |
Non-Matches |
CON | .pdf | test:2.pdf |
Author |
Rating:
Not yet rated.
Andre Van Der Merwe
|
Title |
Test
Details
Pattern Title
|
Expression |
([A-Zäöü0-9\/][^a-z\:\,\(\)]*[A-Zäöü0-9])($|[\.\:\,\;\)\-\ \+]|s\b) |
Description |
Used to dynamically find acronyms in a sentence. The first pair of brackets gets the acronym, the second gets the text after the acronym. |
Matches |
ASN.1 | REGEXP |
Non-Matches |
*** |
Author |
Rating:
Not yet rated.
Eric Lewis
|
Title |
Test
Details
Pattern Title
|
Expression |
^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$ |
Description |
Validates swedish zipcodes (postnr) with or without space between groups. With leading s- or not. Can be disconnected by removing ''(s-|S-){0,1}''. |
Matches |
12345 | 932 68 | S-621 46 |
Non-Matches |
5367 | 425611 | 31 545 |
Author |
Rating:
Not yet rated.
Tommy Ullberg
|
Title |
Test
Details
Font Sizes
|
Expression |
^\d+\x20*([pP][xXtT])?$ |
Description |
It can be used to validate Font Sizes.
Thanks to Gideon Engelberth for the shorter version of my original expression. |
Matches |
1px | 100 PT | 20Px |
Non-Matches |
1abc | px | 1 sdfs |
Author |
Rating:
Not yet rated.
Vincent Faller
|
Title |
Test
Details
Pattern Title
|
Expression |
^[A-Za-z]{2}[0-9]{6}[A-Za-z]{1}$ |
Description |
UK National Insurance Number validation. Especially useful to validate through clientside/server side script on a website. |
Matches |
SP939393H | PX123456D | SW355667G |
Non-Matches |
12SP9393H | S3P93930D | 11223344SP00ddSS |
Author |
Rating:
Not yet rated.
Santosh Potadar
|
Title |
Test
Details
Resale License Number (CA)
|
Expression |
^((([sS][r-tR-Tx-zX-Z])\s*([sx-zSX-Z])?\s*([a-zA-Z]{2,3}))?\s*(\d\d)\s*-?\s*(\d{6,7}))$ |
Description |
California Resale License number validator. Validates Letters and Numbers or Number only. Letters: First 2 letters can be SR, SS, ST , SX, SY, SZ (TAT Code) Next optional letter can be S,X,Y,Z. Next letters must be a minimum of two and a maximum of 3 (District Code). Numbers: Can be 8-9 numbers. Numbers can be delimited with a hypen or spaces after the first 2 numbers. Note: I use () to extract the information I want for use in other scripts. |
Matches |
SR BH 97-578613 | 97578613 | SRXBH97578613 |
Non-Matches |
RR BH 97-578613 | 9757861 | SRAABH 97-578613 |
Author |
Rating:
Not yet rated.
Dean Dal Bozzo
|
Title |
Test
Details
Pattern Title
|
Expression |
(?s)(?:\e\[(?:(\d+);?)*([A-Za-z])(.*?))(?=\e\[|\z) |
Description |
This expression will match all of the commands(escape codes) used in ANSI files. These are what were used to create the colors/blocks on BBS's for those of us that once dialed into them.
http://www.wikipedia.org/wiki/ANSI_escape_code has a reference for ANSI escape codes.
http://idledreams.net/lordscarlet/posts/153.aspx shows an example of the engine I have created surrounding the expression |
Matches |
[32mHello | [1;35mTest | [2J |
Non-Matches |
abc |
Author |
Rating:
Not yet rated.
Doug Moore
|
Displaying page
of
pages;
Items to