Using regexes for extracting data from web pages? Check out
ParseHub,
a visual web scraping tool built by the team behind Debuggex.
1
([a-z0-9\-]{2,63}(?:\.(?:a(?:cademy|ero|rpa|sia|[cdefgilmnoqrstuwxz])|b(?:ike|iz|uilders|uzz|[abdefghijlmnoqrstvwyz])|c(?:ab|amera|amp|areers|at|enter|
eo|lothing|odes|offee|om(?:pany|puter)?|onstruction|ontractors|oop|[acdfghiklmnoruvwxyz])|d(?:iamonds|irectory|omains|[ejkmoz])|e(?:du(?:cation
)?|mail|nterprises|quipment|state|[ceghrstu])|f(?:arm|lorist|[ijkmor])|g(?:allery|lass|raphics|uru|[abdefghlmnpqrstuwy])|h(?:ol(?:dings|iday)|ouse|[kmn
rtu])|i(?:mmobilien|n(?:fo|stitute|ternational)|[delmnoqrst])|j(?:obs|[emop])|k(?:aufen|i(?:tchen|wi)|[eghimnprwxyz])|l(?:and|i(?:ghting|mo)|[abcikrstu
vy])|m(?:anagement|enu|il|obi|useum|[acdefghklmnopqrstuvwxyz])|n(?:ame|et|inja|[acefgilopruz])|o(?:m|nl|rg)|p(?:hoto(?:graphy|s)|lumbing|ost|ro|[aefghk
lmnrstwy])|r(?:e(?:cipes|pair)|uhr|[eosuw])|s(?:exy|hoes|ingles|ol(?:ar|utions)|upport|ystems|[abcdeghijklmnorstuvxyz])|t(?:attoo|echnology|el|ips|oday
|[cdfghjklmnoprtvwz])|u(?:no|[agkmsyz])|v(?:entures|iajes|oyage|[aceginu])|w(?:ang|ien|[fs])|xxx|y(?:[et])|z(?:[amw]))){1,2})$
Unit Tests
(showhide)
Help
You haven't added any unit tests yet
0 Total Tests:
Passing (0);
Failing (0)
No unit tests added.
Expected Matches (hover over highlights for details) | Actual Matches | Edit | Passing |
---|
Show cheatsheet
PCRE regex quick reference (hide):
Full PCRE regex cheatsheet
[abx-z] | One character of: a, b, or the range x-z |
[^abx-z] | One character except: a, b, or the range x-z |
a|b | a or b |
a? | Zero or one a's (greedy) |
a?? | Zero or one a's (lazy) |
a* | Zero or more a's (greedy) |
a*? | Zero or more a's (lazy) |
a+ | One or more a's (greedy) |
a+? | One or more a's (lazy) |
a{4} | Exactly 4 a's |
a{4,8} | Between (inclusive) 4 and 8 a's |
a{9,} | 9 or more a's |
(?>...) | An atomic group |
(?=...) | A positive lookahead |
(?!...) | A negative lookahead |
(?<=...) | A positive lookbehind |
(?<!...) | A negative lookbehind |
(?:...) | A non-capturing group |
(...) | A capturing group |
(?P<n>...) | A capturing group named n |
^ | Beginning of the string |
$ | End of the string |
\d | A digit (same as [0-9]) |
\D | A non-digit (same as [^0-9]) |
\w | A word character (same as [_a-zA-Z0-9]) |
\W | A non-word character (same as [^_a-zA-Z0-9]) |
\s | A whitespace character |
\S | A non-whitespace character |
\b | A word boundary |
\B | A non-word boundary |
\n | A newline |
\t | A tab |
\cY | The control character with the hex code Y |
\xYY | The character with the hex code YY |
\uYYYY | The character with the hex code YYYY |
. | Any character |
\Y | The Y'th captured group |
(?1) | Recurse into numbered group 1 |
(?&x) | Recurse into named group x |
(?P=n) | The captured group named 'n' |
(?#...) | A comment |
Full PCRE regex cheatsheet