public
Last active

Some useful entity RegEx patterns

  • Download Gist
Regex patterns
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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]+))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.