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 1196 posted 11 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 1059 posted 11 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 700 posted 12 years ago by pflangan
Replaces all links within href part of anchor in a HTML-String.
1 3308 posted 12 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 653 posted 12 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 833 posted 12 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 1275 posted 12 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 567 posted 12 years ago by cpres
Useful when using user-submitted URLs
0 499 posted 12 years ago by Entherman
0 886 posted 12 years ago by devnull69
0 628 posted 12 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 901 posted 12 years ago by adrianparr
A really handy snippet that will replace textual URLs with HTML links. Also works for email addresses.
0 1316 posted 12 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 647 posted 12 years ago by nebojsac
Full email validation with regex.
0 1106 posted 12 years ago by nebojsac
{min,max}
0 637 posted 12 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 747 posted 12 years ago by shodan_uk
Returns the video id for any type of youtube url that holds one.
2 1042 posted 12 years ago by KabuqueJoe
0 480 posted 13 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 464 posted 13 years ago by ninjaparade
Useful for stripping out backslashes, hyphens and other punctuation
0 1136 posted 13 years ago by gromitski
Replace "-" with anything you want to. Useful for amending URLs.
0 965 posted 13 years ago by gromitski
Modified regex of URL Matcher found on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
0 526 posted 13 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 684 posted 13 years ago by aelesbao
Turn a string LikeThis into like_this
1 513 posted 13 years ago by jarnaldich
0 620 posted 13 years ago by silentpro
1 2 3 4 5 ... 8