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 2012 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 3886 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 3292 posted 13 years ago by pflangan
Replaces all links within href part of anchor in a HTML-String.
1 5967 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 3173 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 2604 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 3018 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 1197 posted 14 years ago by cpres
Useful when using user-submitted URLs
0 1083 posted 14 years ago by Entherman
0 1645 posted 14 years ago by devnull69
0 1337 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 1638 posted 14 years ago by adrianparr
A really handy snippet that will replace textual URLs with HTML links. Also works for email addresses.
0 2015 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 2281 posted 14 years ago by nebojsac
Full email validation with regex.
0 2977 posted 14 years ago by nebojsac
{min,max}
0 1312 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 3441 posted 14 years ago by shodan_uk
Returns the video id for any type of youtube url that holds one.
2 2090 posted 14 years ago by KabuqueJoe
0 1102 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 1040 posted 14 years ago by ninjaparade
Useful for stripping out backslashes, hyphens and other punctuation
0 3898 posted 14 years ago by gromitski
Replace "-" with anything you want to. Useful for amending URLs.
0 1861 posted 14 years ago by gromitski
Modified regex of URL Matcher found on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
0 1190 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 1385 posted 14 years ago by aelesbao
Turn a string LikeThis into like_this
1 1105 posted 14 years ago by jarnaldich
0 1261 posted 14 years ago by silentpro
1 2 3 4 5 ... 8