Skip to content

Instantly share code, notes, and snippets.

@christopherdebeer
Created July 27, 2010 09:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christopherdebeer/491994 to your computer and use it in GitHub Desktop.
Save christopherdebeer/491994 to your computer and use it in GitHub Desktop.
Some useful entity RegEx patterns
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