<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/regular</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 19 Jun 2013 20:23:58 GMT</pubDate>
<item>
<title>(Regular Expression) Regex Leading and Trailing Whitespace - Pavonz</title>
<link>http://snipplr.com/view/70938/regex-leading-and-trailing-whitespace/</link>
<description><![CDATA[ <p>Leading and Trailing Whitespace</p> ]]></description>
<pubDate>Fri, 26 Apr 2013 15:59:40 GMT</pubDate>
<guid>http://snipplr.com/view/70938/regex-leading-and-trailing-whitespace/</guid>
</item>
<item>
<title>(Regular Expression) Hexadecimal color regex match - guilhermehn</title>
<link>http://snipplr.com/view/65915/hexadecimal-color-regex-match/</link>
<description><![CDATA[ <p>Regex code to match hexadecimal colors</p> ]]></description>
<pubDate>Tue, 03 Jul 2012 07:04:53 GMT</pubDate>
<guid>http://snipplr.com/view/65915/hexadecimal-color-regex-match/</guid>
</item>
<item>
<title>(PHP) Remove superfluous line breaks between HTML elements. - pumpkinthehead</title>
<link>http://snipplr.com/view/65826/remove-superfluous-line-breaks-between-html-elements/</link>
<description><![CDATA[ <p>A regular expression for removing  and  (case insensitive) between HTML elements if there is no content between the HTML elements.  It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visual editor was returned from the PHP nl2br() method.</p> ]]></description>
<pubDate>Wed, 27 Jun 2012 08:18:51 GMT</pubDate>
<guid>http://snipplr.com/view/65826/remove-superfluous-line-breaks-between-html-elements/</guid>
</item>
<item>
<title>(Apache) .htaccess script to block remote access and allow local ip - aruldave</title>
<link>http://snipplr.com/view/64941/htaccess-script-to-block-remote-access-and-allow-local-ip/</link>
<description><![CDATA[ <p>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 Dialler Software for Call Centres](http://touchstarccs.co.uk/ "Automated Predictive Dialler Software for Call Centres")</p> ]]></description>
<pubDate>Fri, 18 May 2012 20:56:18 GMT</pubDate>
<guid>http://snipplr.com/view/64941/htaccess-script-to-block-remote-access-and-allow-local-ip/</guid>
</item>
<item>
<title>(PHP) Remove / Replace - href / anchor /link - in html /string - preg_replace - php - regex - regular expression - rwunsch</title>
<link>http://snipplr.com/view/63981/remove--replace--href--anchor-link--in-html-string--pregreplace--php--regex--regular-expression/</link>
<description><![CDATA[ <p>Replaces all links within href part of anchor in a HTML-String.</p> ]]></description>
<pubDate>Sat, 17 Mar 2012 03:20:17 GMT</pubDate>
<guid>http://snipplr.com/view/63981/remove--replace--href--anchor-link--in-html-string--pregreplace--php--regex--regular-expression/</guid>
</item>
<item>
<title>(PHP) URLs in Text, and Parsing them into Hyperlinked HTML urls - aamirrajpoot</title>
<link>http://snipplr.com/view/58653/urls-in-text-and-parsing-them-into-hyperlinked-html-urls/</link>
<description><![CDATA[ <p>Try something like this.

$pattern = "/http:\/\/(www\.)?([^.]+\.[^.\s]+\.?[^.\s]*)/i";
$replace = "http://\\1\\2";
$string = [url=http://us2.php.net/preg-replace]preg_replace[/url]($pattern,$replace,$string);
echo $string;

Where $string is the text. Just a couple notes about this pattern:
1) The URI MUST have "http://" before it
2) It works for URIs formatted in the following ways
>>>http://www.example.foo
>>>http://www.example.foo.foo #having two
>>>http://example.foo
>>>http://example.foo.foo #having two
>>>http://foo.exmaple.foo #pretty much the same as above</p> ]]></description>
<pubDate>Wed, 14 Sep 2011 00:20:15 GMT</pubDate>
<guid>http://snipplr.com/view/58653/urls-in-text-and-parsing-them-into-hyperlinked-html-urls/</guid>
</item>
<item>
<title>(PHP) Clean User Submitted URL's - Entherman</title>
<link>http://snipplr.com/view/58063/clean-user-submitted-urls/</link>
<description><![CDATA[ <p>Useful when using user-submitted URLs</p> ]]></description>
<pubDate>Sun, 21 Aug 2011 01:35:35 GMT</pubDate>
<guid>http://snipplr.com/view/58063/clean-user-submitted-urls/</guid>
</item>
<item>
<title>(Python) CHeck the length of the mdn - ronakpatel2006</title>
<link>http://snipplr.com/view/57743/check-the-length-of-the-mdn/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 11 Aug 2011 10:11:33 GMT</pubDate>
<guid>http://snipplr.com/view/57743/check-the-length-of-the-mdn/</guid>
</item>
<item>
<title>(JavaScript) Regular expression matching text (Size) in javascript - punuhan</title>
<link>http://snipplr.com/view/56513/regular-expression-matching-text-size-in-javascript/</link>
<description><![CDATA[ <p>Matches the word starting with si or Si and containing : in the word also as an optional. The expression can be tested here http://rejex.heroku.com/</p> ]]></description>
<pubDate>Wed, 13 Jul 2011 16:17:16 GMT</pubDate>
<guid>http://snipplr.com/view/56513/regular-expression-matching-text-size-in-javascript/</guid>
</item>
<item>
<title>(PHP) Replace URLs with links - PHP - plesh</title>
<link>http://snipplr.com/view/56479/replace-urls-with-links--php/</link>
<description><![CDATA[ <p>A really handy snippet that will replace textual URLs with HTML links.

Also works for email addresses.</p> ]]></description>
<pubDate>Tue, 12 Jul 2011 22:37:53 GMT</pubDate>
<guid>http://snipplr.com/view/56479/replace-urls-with-links--php/</guid>
</item>
<item>
<title>(MySQL) MySQL  - Regular expressions - erraja_07</title>
<link>http://snipplr.com/view/53121/mysql---regular-expressions/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 May 2011 23:57:42 GMT</pubDate>
<guid>http://snipplr.com/view/53121/mysql---regular-expressions/</guid>
</item>
<item>
<title>(ActionScript 3) Extract domain name with RegExp - hejaaa</title>
<link>http://snipplr.com/view/51619/extract-domain-name-with-regexp/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 06 Apr 2011 01:54:53 GMT</pubDate>
<guid>http://snipplr.com/view/51619/extract-domain-name-with-regexp/</guid>
</item>
<item>
<title>(PHP) Get Width and Height From a Filename - brownrl</title>
<link>http://snipplr.com/view/48846/get-width-and-height-from-a-filename/</link>
<description><![CDATA[ <p>I use this little guy to get the width and height from a filename. Often when I need to show a flash swf file I don't have an easy way to tell the width and the height of the file for display. However is the file name is "some_flash_file 300x250.swf" then this litte guy will help a lot.</p> ]]></description>
<pubDate>Fri, 11 Feb 2011 19:56:04 GMT</pubDate>
<guid>http://snipplr.com/view/48846/get-width-and-height-from-a-filename/</guid>
</item>
<item>
<title>(ActionScript 3) AS3 Replace Special XML Characters with Entity Names (Partial Set) - adrianparr</title>
<link>http://snipplr.com/view/45887/as3-replace-special-xml-characters-with-entity-names-partial-set/</link>
<description><![CDATA[ <p>These five characters should be replaced with their HTML entity names before being used in XML, otherwise they may cause the XML to be invalid.</p> ]]></description>
<pubDate>Fri, 17 Dec 2010 23:00:40 GMT</pubDate>
<guid>http://snipplr.com/view/45887/as3-replace-special-xml-characters-with-entity-names-partial-set/</guid>
</item>
<item>
<title>(XML) Update version number with Regular Expression using MSBuild - cappellin</title>
<link>http://snipplr.com/view/44674/update-version-number-with-regular-expression-using-msbuild/</link>
<description><![CDATA[ <p>This snippet replaces all three different version strings in file `verid.h` using regular expressions with the value of properties `$(Major)`, `%(Minor)`, `$(SP)` and `$(Build)` when the property `$(Label)` has value _true_.
To run this project you need MSBuild and the open source tasks library for MSBuild by [tigris.org](http://msbuildtasks.tigris.org/ "tigris.org").

Here is an example of file `verid.h`:

    // File version
    #define szVerId_IDS_VERSION         "1.40 (00) - Build (26)"
    #define szVerId_FILEVERSION         "1.40.00.26"
    #define   VerId_FILEVERSION          1,40,00,26
    
    // Product version
    #define szVerId_PRODUCTVERSION      "1.40.00.26"
    #define   VerId_PRODUCTVERSION       1,40,00,26</p> ]]></description>
<pubDate>Mon, 22 Nov 2010 22:52:42 GMT</pubDate>
<guid>http://snipplr.com/view/44674/update-version-number-with-regular-expression-using-msbuild/</guid>
</item>
<item>
<title>(Other) Xcode Regex Find and Replace - tuesdaycreative</title>
<link>http://snipplr.com/view/43274/xcode-regex-find-and-replace/</link>
<description><![CDATA[ <p>This example attempts to reorder pointer declarations so that the asterisk is adjacent to the class name.  It searches for a letter, asterisk and space, and a letter.  It replaces that group with the initial letter, "* ", and the final letter.

Parentheses in the regular expressions register a group number.

The regular expression used here only matches letters.  Add 0-9 in the square brackets to search for numbers as well.</p> ]]></description>
<pubDate>Sat, 30 Oct 2010 06:18:11 GMT</pubDate>
<guid>http://snipplr.com/view/43274/xcode-regex-find-and-replace/</guid>
</item>
<item>
<title>(Ruby) Strip characters from between two delimiters - webonomic</title>
<link>http://snipplr.com/view/42947/strip-characters-from-between-two-delimiters/</link>
<description><![CDATA[ <p>This regular expression used in Ruby will extract the characters between single or multi-character delimiters.  It helps when you have strange delimiters such as \":delimeter1: text I want to grab goes here :delimiter2:\"</p> ]]></description>
<pubDate>Tue, 26 Oct 2010 04:00:58 GMT</pubDate>
<guid>http://snipplr.com/view/42947/strip-characters-from-between-two-delimiters/</guid>
</item>
<item>
<title>(PHP) PHP : expressions regulieres les plus courantes et exemple de test avec ereg() - alexandrepayet</title>
<link>http://snipplr.com/view/39135/php--expressions-regulieres-les-plus-courantes-et-exemple-de-test-avec-ereg/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 16 Aug 2010 21:43:33 GMT</pubDate>
<guid>http://snipplr.com/view/39135/php--expressions-regulieres-les-plus-courantes-et-exemple-de-test-avec-ereg/</guid>
</item>
<item>
<title>(Ruby) Regular Expression to Create URL Permutations in Ruby - viatropos</title>
<link>http://snipplr.com/view/39007/regular-expression-to-create-url-permutations-in-ruby/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 13 Aug 2010 02:51:41 GMT</pubDate>
<guid>http://snipplr.com/view/39007/regular-expression-to-create-url-permutations-in-ruby/</guid>
</item>
<item>
<title>(Regular Expression) URL Matching - benrasmusen</title>
<link>http://snipplr.com/view/38078/url-matching/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 30 Jul 2010 06:53:31 GMT</pubDate>
<guid>http://snipplr.com/view/38078/url-matching/</guid>
</item>
</channel>
</rss>