<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Processing a WordPress export file with PowerShell</title>
	<atom:link href="http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/</link>
	<description>Strategies for Internet citizens</description>
	<lastBuildDate>Mon, 13 Feb 2012 06:40:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ophelia Westrich</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-139458</link>
		<dc:creator><![CDATA[Ophelia Westrich]]></dc:creator>
		<pubDate>Wed, 27 Oct 2010 16:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-139458</guid>
		<description><![CDATA[Intriguing. Have been trying to learn a new language for a while so this is extremely relevant! Thanks.]]></description>
		<content:encoded><![CDATA[<p>Intriguing. Have been trying to learn a new language for a while so this is extremely relevant! Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PowerShell: Search, Replace Text in Files &#171; House of Blog</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-131651</link>
		<dc:creator><![CDATA[PowerShell: Search, Replace Text in Files &#171; House of Blog]]></dc:creator>
		<pubDate>Tue, 26 Jan 2010 15:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-131651</guid>
		<description><![CDATA[[...] This post was inspired by this discussion. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] This post was inspired by this discussion. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Владимир</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126828</link>
		<dc:creator><![CDATA[Владимир]]></dc:creator>
		<pubDate>Thu, 26 Feb 2009 10:28:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126828</guid>
		<description><![CDATA[Автор, а вы случайно не из Москвы?]]></description>
		<content:encoded><![CDATA[<p>Автор, а вы случайно не из Москвы?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Андрей</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126806</link>
		<dc:creator><![CDATA[Андрей]]></dc:creator>
		<pubDate>Mon, 23 Feb 2009 09:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126806</guid>
		<description><![CDATA[Автор молодец))))хих Скажите, а у вас есть RSS поток в этом блоге?]]></description>
		<content:encoded><![CDATA[<p>Автор молодец))))хих Скажите, а у вас есть RSS поток в этом блоге?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Юрий</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126786</link>
		<dc:creator><![CDATA[Юрий]]></dc:creator>
		<pubDate>Fri, 20 Feb 2009 03:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126786</guid>
		<description><![CDATA[Написать пост на пол страницы время есть, а ответить нет? Нормально]]></description>
		<content:encoded><![CDATA[<p>Написать пост на пол страницы время есть, а ответить нет? Нормально</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Оля</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126659</link>
		<dc:creator><![CDATA[Оля]]></dc:creator>
		<pubDate>Sat, 31 Jan 2009 22:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-126659</guid>
		<description><![CDATA[Я писал что-то подобное, но у Вас тема более глубого раскрыта]]></description>
		<content:encoded><![CDATA[<p>Я писал что-то подобное, но у Вас тема более глубого раскрыта</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Third Bit &#187; Blog Archive &#187; Link Soup Redux</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81481</link>
		<dc:creator><![CDATA[The Third Bit &#187; Blog Archive &#187; Link Soup Redux]]></dc:creator>
		<pubDate>Mon, 12 Nov 2007 19:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81481</guid>
		<description><![CDATA[[...] Udell is messing with PowerShell again. I really wish I had time to get into this, and still think a Javascript-based open source [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Udell is messing with PowerShell again. I really wish I had time to get into this, and still think a Javascript-based open source [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Multilingual idioms &#171; Jon Udell</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81287</link>
		<dc:creator><![CDATA[Multilingual idioms &#171; Jon Udell]]></dc:creator>
		<pubDate>Mon, 12 Nov 2007 15:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81287</guid>
		<description><![CDATA[[...] this example I used a combination of PowerShell and Python because each afforded convenient access to a familiar [...]]]></description>
		<content:encoded><![CDATA[<p>[...] this example I used a combination of PowerShell and Python because each afforded convenient access to a familiar [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81238</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Mon, 12 Nov 2007 14:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81238</guid>
		<description><![CDATA[&gt; http://www.rosettacode.org/ 

Excellent!]]></description>
		<content:encoded><![CDATA[<p>&gt; <a href="http://www.rosettacode.org/" rel="nofollow">http://www.rosettacode.org/</a> </p>
<p>Excellent!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81236</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Mon, 12 Nov 2007 14:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-81236</guid>
		<description><![CDATA[&gt; $re = New-Object regex ’.+?’,Singleline

Got it. That&#039;s nice and succinct, thanks!]]></description>
		<content:encoded><![CDATA[<p>&gt; $re = New-Object regex ’.+?’,Singleline</p>
<p>Got it. That&#8217;s nice and succinct, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Reid</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-79411</link>
		<dc:creator><![CDATA[Kevin Reid]]></dc:creator>
		<pubDate>Sat, 10 Nov 2007 19:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-79411</guid>
		<description><![CDATA[&quot;a kind of Rosetta Stone of patterns&quot;: http://www.rosettacode.org/ . Small but growing. Your example would fit in fine, I think.]]></description>
		<content:encoded><![CDATA[<p>&#8220;a kind of Rosetta Stone of patterns&#8221;: <a href="http://www.rosettacode.org/" rel="nofollow">http://www.rosettacode.org/</a> . Small but growing. Your example would fit in fine, I think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Payette [MSFT]</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78833</link>
		<dc:creator><![CDATA[Bruce Payette [MSFT]]]></dc:creator>
		<pubDate>Sat, 10 Nov 2007 01:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78833</guid>
		<description><![CDATA[The options for a .NET regular expression can be specified as part of the pattern itself. For example:
   &#039;(?s)abd&#039;
specifies a pattern with SingleLine turned on. (This work in Python too of course). The documentation for this is at:

http://msdn2.microsoft.com/en-us/library/yd1hzczs.aspx

Alternatively you could do the same thing in PowerShell that you did in the Python code:

$re = New-Object regex ’.+?’,Singleline

However, the other thing you&#039;re going to run into with gc (Get-Content) is that, in PowerShell V1, Get-Content always splits the file into lines. To workaround this, do

$xml = [io.file]::ReadAllText((resolve-path $path)) -replace &#039;(?s)...pattern....&#039;,&#039;&#039;
$xml &#124; out-file -enc ascii

(We&#039;re planning to fix this issue in the next release.)

-bruce]]></description>
		<content:encoded><![CDATA[<p>The options for a .NET regular expression can be specified as part of the pattern itself. For example:<br />
   &#8216;(?s)abd&#8217;<br />
specifies a pattern with SingleLine turned on. (This work in Python too of course). The documentation for this is at:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/yd1hzczs.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/yd1hzczs.aspx</a></p>
<p>Alternatively you could do the same thing in PowerShell that you did in the Python code:</p>
<p>$re = New-Object regex ’.+?’,Singleline</p>
<p>However, the other thing you&#8217;re going to run into with gc (Get-Content) is that, in PowerShell V1, Get-Content always splits the file into lines. To workaround this, do</p>
<p>$xml = [io.file]::ReadAllText((resolve-path $path)) -replace &#8216;(?s)&#8230;pattern&#8230;.&#8217;,&#8221;<br />
$xml | out-file -enc ascii</p>
<p>(We&#8217;re planning to fix this issue in the next release.)</p>
<p>-bruce</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78720</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Fri, 09 Nov 2007 22:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78720</guid>
		<description><![CDATA[It&#039;s a multiline match, though. I know how to do it this way in IronPython using the .NET regex system:

import clr
from System.Text.RegularExpressions import Regex, RegexOptions
xml = open(&#039;wordpress.xml&#039;).read()
re = Regex(&#039;&lt;wp:comment&gt;.+?&lt;/wp:comment&gt;&#039;,RegexOptions.Singleline)
xml = re.Replace(xml,&#039;&#039;)

Can you specify the regex option natively in PowerShell or would you need to construct a .NET regex object in similar fashion?

(And...why Singleline?)

]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s a multiline match, though. I know how to do it this way in IronPython using the .NET regex system:</p>
<p>import clr<br />
from System.Text.RegularExpressions import Regex, RegexOptions<br />
xml = open(&#8216;wordpress.xml&#8217;).read()<br />
re = Regex(&#8216;&lt;wp:comment&gt;.+?&lt;/wp:comment&gt;&#8217;,RegexOptions.Singleline)<br />
xml = re.Replace(xml,&#8221;)</p>
<p>Can you specify the regex option natively in PowerShell or would you need to construct a .NET regex object in similar fashion?</p>
<p>(And&#8230;why Singleline?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Payette [MSFT]</title>
		<link>http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78654</link>
		<dc:creator><![CDATA[Bruce Payette [MSFT]]]></dc:creator>
		<pubDate>Fri, 09 Nov 2007 20:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/2007/11/09/processing-a-wordpress-export-file-with-powershell/#comment-78654</guid>
		<description><![CDATA[Actually non-greedy matches use the same notation in PowerShell as they do in the Python example. For example:

PS (9) &gt; &#039;afoobfooc&#039; -replace &#039;.+?&#039;,&#039;&#039;
abc

The PowerShell equvalent of the Python code would probably be something like:

    $modified = (gc wordpress.xml) -replace &#039;.+?&#039;,&#039;&#039;
    $modified &#124; out-file -encoding ascii wordpress.xml # save as ascii

If saving the file as unicode is acceptable, then the last line become
    $modified &gt; wordpress.xml 

As an aside, PowerShell just uses .NET regular expressions. The syntax for these expressions is documented at:

http://msdn2.microsoft.com/en-us/library/1400241x.aspx

-bruce

=====================================
Bruce Payette [MSFT]
Principal Developer, Windows PowerShell
Microsoft Corporation.]]></description>
		<content:encoded><![CDATA[<p>Actually non-greedy matches use the same notation in PowerShell as they do in the Python example. For example:</p>
<p>PS (9) &gt; &#8216;afoobfooc&#8217; -replace &#8216;.+?&#8217;,&#8221;<br />
abc</p>
<p>The PowerShell equvalent of the Python code would probably be something like:</p>
<p>    $modified = (gc wordpress.xml) -replace &#8216;.+?&#8217;,&#8221;<br />
    $modified | out-file -encoding ascii wordpress.xml # save as ascii</p>
<p>If saving the file as unicode is acceptable, then the last line become<br />
    $modified &gt; wordpress.xml </p>
<p>As an aside, PowerShell just uses .NET regular expressions. The syntax for these expressions is documented at:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/1400241x.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/1400241x.aspx</a></p>
<p>-bruce</p>
<p>=====================================<br />
Bruce Payette [MSFT]<br />
Principal Developer, Windows PowerShell<br />
Microsoft Corporation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

