<?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/tag/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>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>
	</channel>
</rss>

