<?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/Expression</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Mon, 20 May 2013 03:24:21 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>(JavaScript) After Effects expression random flicker - one984</title>
<link>http://snipplr.com/view/59310/after-effects-expression-random-flicker/</link>
<description><![CDATA[ <p>After Effects expression random flicker</p> ]]></description>
<pubDate>Sat, 01 Oct 2011 09:47:53 GMT</pubDate>
<guid>http://snipplr.com/view/59310/after-effects-expression-random-flicker/</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>(JavaScript) Javascript RegEx Repetition Limiting - simondiercks</title>
<link>http://snipplr.com/view/55086/javascript-regex-repetition-limiting/</link>
<description><![CDATA[ <p>{min,max}</p> ]]></description>
<pubDate>Thu, 09 Jun 2011 19:18:02 GMT</pubDate>
<guid>http://snipplr.com/view/55086/javascript-regex-repetition-limiting/</guid>
</item>
<item>
<title>(VB.NET) Update a value to entire rows in a column in dataset without looping - derebus</title>
<link>http://snipplr.com/view/53127/update-a-value-to-entire-rows-in-a-column-in-dataset-without-looping/</link>
<description><![CDATA[ <p>Update a value to entire rows in a column in dataset without looping</p> ]]></description>
<pubDate>Fri, 06 May 2011 04:08:42 GMT</pubDate>
<guid>http://snipplr.com/view/53127/update-a-value-to-entire-rows-in-a-column-in-dataset-without-looping/</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>(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>(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>
<item>
<title>(Regular Expression) RegEx Regular Expression to match < > java doc tags in JSP (liferay) - brandonjp</title>
<link>http://snipplr.com/view/37835/regex-regular-expression-to-match---java-doc-tags-in-jsp-liferay/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 24 Jul 2010 02:17:40 GMT</pubDate>
<guid>http://snipplr.com/view/37835/regex-regular-expression-to-match---java-doc-tags-in-jsp-liferay/</guid>
</item>
<item>
<title>(C#) Return string from between two matched strings - blackf0rk</title>
<link>http://snipplr.com/view/35199/return-string-from-between-two-matched-strings/</link>
<description><![CDATA[ <p>This code will take a start and end string and then search for them within the subject string. It returns what is between the start and end strings. As an example, if I had the following text...

Some test text string, with a start  and an end .

...I could call this function to get the text between the  and the  strings. This function will return: "and an end"</p> ]]></description>
<pubDate>Tue, 25 May 2010 11:40:25 GMT</pubDate>
<guid>http://snipplr.com/view/35199/return-string-from-between-two-matched-strings/</guid>
</item>
</channel>
</rss>