<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; regex</title>
	<atom:link href="http://www.ladysign-apps.com/blog/category/code/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Protect from deeplinking</title>
		<link>http://www.ladysign-apps.com/blog/code/regex/protect-from-deeplinking/</link>
		<comments>http://www.ladysign-apps.com/blog/code/regex/protect-from-deeplinking/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 12:42:30 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[geeky]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=827</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
A good example of deeplinking is that an other website is embedding your content (for example images or video&#8217;s) in[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/regex/protect-from-deeplinking/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
A good example of deeplinking is that an other website is embedding your content (for example images or video&#8217;s) into his/her website.<br />
Therefore this website does not need share own content. &#8211; The nasty thing is; that this will cost you bandwidth.<br />
It loads content from your website, but without a site visit. Especially when full video&#8217;s are loaded, you don&#8217;t want this.</p>
<p>You can protect yourself from deeplinking.<br />
In your <strong>.htaccess file</strong> add the following lines (notice the file extensions and your own domain):</p>
<pre class="brush: jscript; title: ;">Options +SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(.*\.)?mydomain.com(/)?.*$ [NC]
RewriteRule .*\.(wmv|asx|jpg|gif|jpeg)$ http://localhost/ [R,NC] </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/regex/protect-from-deeplinking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Regex, replace begin and end of the line</title>
		<link>http://www.ladysign-apps.com/blog/code/regex/regex-replace-begin-and-end-of-the-line/</link>
		<comments>http://www.ladysign-apps.com/blog/code/regex/regex-replace-begin-and-end-of-the-line/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 16:35:55 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[regex]]></category>
		<category><![CDATA[begin line]]></category>
		<category><![CDATA[end line]]></category>
		<category><![CDATA[matches]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=396</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>My friend was complaining, he had a whole list of integer numbers, which need to be replaced as a string.<br />
Well instead of[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/regex/regex-replace-begin-and-end-of-the-line/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>My friend was complaining, he had a whole list of integer numbers, which need to be replaced as a string.<br />
Well instead of replacing line by line, you can use regex (and a nice editor such as Scite or PSPad) I told him:<br />
For example:</p>
<p>123456<br />
124457<br />
147778<br />
121775<br />
&#8230;</p>
<p>to -></p>
<p>&#8216;123456&#8242;,<br />
&#8216;124457&#8242;,<br />
&#8216;147778&#8242;,<br />
&#8216;121775&#8242;,<br />
&#8230;</p>
<p>It&#8217;s a piece of cake:<br />
The ^ matches the begin of the line.<br />
The $ matches the end of the line.</p>
<pre class="brush: jscript; title: ;">
//Find
^
//Replace
'
</pre>
<p>And:</p>
<pre class="brush: jscript; title: ;">
//Find
$
//Replace
',
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/regex/regex-replace-begin-and-end-of-the-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy Regex Tool</title>
		<link>http://www.ladysign-apps.com/blog/code/regex/handy-regex-tool/</link>
		<comments>http://www.ladysign-apps.com/blog/code/regex/handy-regex-tool/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 12:19:55 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/Blog/?p=10</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Test your Regex online with this handy Rich Internet Application.<br />
(Note Adobe Flash 9 player is required).</p>
<p><a href="http://gskinner.com/RegExr/">http://gskinne[......]</a></p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/regex/handy-regex-tool/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Test your Regex online with this handy Rich Internet Application.<br />
(Note Adobe Flash 9 player is required).</p>
<p><a href="http://gskinner.com/RegExr/">http://gskinner.com/RegExr/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/regex/handy-regex-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex</title>
		<link>http://www.ladysign-apps.com/blog/code/regex/regex/</link>
		<comments>http://www.ladysign-apps.com/blog/code/regex/regex/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 16:48:04 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/Blog/20080920/regex/</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Last week I had to convert an excel sheet to the XML format. Okay that&#8217;s an easy one, was what I was thinking cause[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/regex/regex/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Last week I had to convert an excel sheet to the XML format. Okay that&#8217;s an easy one, was what I was thinking cause with Microsoft Office you can export to XML. Never the less, the rendered output looked dirty. Same XML namespaces but different ids. That was totally different then what I needed for my just created Flash program. My peace of software can only read clean XML code.</p>
<p>You probably will understand that I was not happy with the idea, that I had to take the excel sheet over by hand. And since I&#8217;m lazy (~all programmers are!~) it found an idea which could spare me a lot of time.</p>
<p>The solution is easy. Use regex. &#8211; With a text editor (I used <a target="_blank" href="http://www.pspad.com/">PSPad</a>) and some regular expressions, you can easily generate from a dirty MS Office XML to your own clean XML markup. Just do a Find and Replace All:</p>
<pre class="brush: jscript; title: ;">
//FIND:
&lt;TAG&gt;(.+?)&lt;/TAG&gt;
//REPLACE:
&lt;YOURTAG&gt;$1&lt;/YOURTAG&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/regex/regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

