Welcome To Snipplr


Everyone's Recent Snippets Tagged regex



1 2 3 4 5 ... 8
Text filter to increment numbers by one with regex in BBEdit (Mac only)
0 1884 posted 13 years ago by page_lab
The below code lets you stop access from the remote IPs excluding your local machine IP. This code can be setup where someone wants to provide an internal access and restricting the external access for the web service. - [Automated Predictive Dial...
0 3632 posted 13 years ago by aruldave
Requirement from work was to refactor an 8000 line if elseif code block to select case syntax. Not a manual task, even for a 1984 olympics button bashing champ. note, id is the test variable here, as in elseif (id ="test") then ...
0 3057 posted 13 years ago by pflangan
Replaces all links within href part of anchor in a HTML-String.
1 5541 posted 13 years ago by rwunsch
This regex captures non-printing characters (specifically those found when copying text from Photoshop). It's not fully tested, but it worked for me when I needed it. I will add to it as necessary.
0 2938 posted 13 years ago by oobleck
Find the date with or without a year and with double or single digit month or day. Easily extendable to other date delimiters and formats.
0 2289 posted 13 years ago by pumpkinthehead
This will get the 11-character YouTube video ID from any valid YouTube URL. Based on http://snipplr.com/view/57065/get-youtube-video-id/ but made more robust to handle additional URL inputs
0 2718 posted 13 years ago by jmiller
Working on an ecommerce site I found out from our Japanese distrubutors that they don't have a decimal for the currency since yen doesn't deal in change. 1 yen is a fraction of a cent anyway! This code looks for the Yen since within a <span></span...
0 1080 posted 13 years ago by cpres
Useful when using user-submitted URLs
0 1000 posted 14 years ago by Entherman
0 1488 posted 14 years ago by devnull69
0 1207 posted 14 years ago by resting
If you don't deal with namespaces in XML correctly they can break your parsing in AS3. One way of getting around this is to remove the namespace from the XML a using regular expression.
0 1518 posted 14 years ago by adrianparr
A really handy snippet that will replace textual URLs with HTML links. Also works for email addresses.
0 1910 posted 14 years ago by plesh
Returns the same string, except with links wrapped in <a href=""> tags. Works on www.snipplr.com and on http://snipplr.com A variation of the script on the attached URL.
0 2006 posted 14 years ago by nebojsac
Full email validation with regex.
0 2637 posted 14 years ago by nebojsac
{min,max}
0 1185 posted 14 years ago by simondiercks
Ridiculously comprehensive date validation regex - matches dd/mm/yyyy or dd/mm/yy. Also correctly matches number of days in months. ie. it won't match 30th Feb...
0 3170 posted 14 years ago by shodan_uk
Returns the video id for any type of youtube url that holds one.
2 1851 posted 14 years ago by KabuqueJoe
0 984 posted 14 years ago by Risse
Encode a Tweet from a Twitter search query wrapping all hash tags, user names and urls with herf entities with one function call
0 931 posted 14 years ago by ninjaparade
Useful for stripping out backslashes, hyphens and other punctuation
0 3596 posted 14 years ago by gromitski
Replace "-" with anything you want to. Useful for amending URLs.
0 1668 posted 14 years ago by gromitski
Modified regex of URL Matcher found on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
0 1063 posted 14 years ago by naren1012
The regular expression must be in non-literal notation; so replace all backslashes with two backslashes (e.g. ^\w+$ -> ^\\w+$). All searches are case insensitive; you can change this by removing the ‘i’ flag in the plugin.
1 1243 posted 14 years ago by aelesbao
Turn a string LikeThis into like_this
1 1029 posted 14 years ago by jarnaldich
0 1137 posted 14 years ago by silentpro
1 2 3 4 5 ... 8