Created
July 27, 2015 08:01
-
-
Save arjenblokzijl/b0bd9d2db524b42c6a4b to your computer and use it in GitHub Desktop.
War tested PHP regular expressions
This file contains 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
Dutch Chamber of Commerce > /(?<!\d)\d{8}(?!\d)/ | |
Dutch postal code > /^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$/i | |
General URL > @(https?|ftp)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$@i | |
LinkedIn URL > /(ftp|http|https):\/\/?((www|\w\w)\.)?linkedin.com(\w+:{0,1}\w*@)?(\S+)(:([0-9])+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment