Created
July 27, 2010 09:53
-
-
Save christopherdebeer/491994 to your computer and use it in GitHub Desktop.
Some useful entity RegEx patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some useful entity RegEx patterns | |
by Christopher de Beer | |
27 July 2010 | |
They're not perfect, | |
i'll keep fixing up the leaks as I go. (next... adding lookarounds) | |
He'll, I'll ,She'd etc : ([a-zA-Z]+['’][a-z]{1,3}) | |
Social-media, T-shirt, movie-star, 2010-02-04 : ([a-zA-Z0-9]+(\-[0-9a-zA-Z]+)+) | |
Acronyms: U.S. , L.S.D. : ([A-Z]\.)+([A-Z]\.)+ | |
20:32:00am, 8,000km, 20:32 : ([0-9]+[.,:])+[0-9]+(km|m|am|pm|cm|mm|px|pt|ft|)* | |
2010-02-04, 27/12/2010 : [0-9]{1,4}[/\-][0-9]{1,4}[/\-][0-9]{1,4} | |
@twitterName : [^a-z,^A-Z,^0-9]@([a-z,A-z,-9]+) | |
twitter.com/twitterName , @twitterName : (?:twitter\.com\/([a-zAZ0-9]+))|(?:[^a-z,^A-Z,^0-9]@([a-z,A-z,-9]+)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment