jpcody + regex   3

In search of the perfect URL validation regex
Assume that this regex will be used for a public URL shortener written in PHP, so URLs like http://localhost/, //foo.bar/, ://foo.bar/, data:text/plain;charset=utf-8,OHAI and tel:+1234567890 shouldn’t pass (even though they’re technically valid). Also, in this case I only want to allow the HTTP, HTTPS and FTP protocols.
regex 
november 2011 by jpcody
​j​Q​u​e​r​y​ ​R​e​g​u​l​a​r​ ​E​x​p​r​e​s​s​i​o​n​s​ ​R​e​v​i​e​w​ ​(​R​e​v​:​2​0​1​0​0​9​2​1​_​1​7​0​0​)
jQuery is a very popular Javascript framework which internally utilizes a number of regular expressions. Most of these regexes work correctly and accurately match (and fail to match) their intended targets. However, quite a few of these can be improved with regard to efficiency (some with regard to matching, others with regard to non-matching - both are important). A comprehensive review of all jQuery regular expressions was recently performed, and this article presents the results of this analysis and offers improved versions. (The jQuery version analyzed was 1.4.3pre: Git commit #747ba7defd82bffa6c7ccb69e53b834cbfddb62c 20-Sep-2010.)
javascript  jquery  regex 
september 2010 by jpcody
Daring Fireball: A Liberal, Accurate Regex Pattern for Matching URLs
A common problem programming problem: identify the URLs in an arbitrary string of text, where by “arbitrary” let’s agree we mean something unstructured such as an email message or a tweet. I offer a solution, in the form of the following regex pattern:
regex  urls  programming 
november 2009 by jpcody

Copy this bookmark:



description:


tags: