<?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/"
		>
<channel>
	<title>Comments on: Learning to Love Regular Expressions</title>
	<atom:link href="http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Wed, 12 Jun 2013 12:35:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Sarah Wait Zaranek</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33269</link>
		<dc:creator>Sarah Wait Zaranek</dc:creator>
		<pubDate>Tue, 06 Nov 2012 16:37:42 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33269</guid>
		<description><![CDATA[@Antonio - 

You are welcome.  Glad you liked it.]]></description>
		<content:encoded><![CDATA[<p>@Antonio &#8211; </p>
<p>You are welcome.  Glad you liked it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33253</link>
		<dc:creator>Antonio</dc:creator>
		<pubDate>Thu, 01 Nov 2012 15:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33253</guid>
		<description><![CDATA[I like this article. I use to work with matlab to calculate numbers but It&#039;s also a fantastic tool to work with texts. The normal applications need to display some texts to improve their understanding.
Thanks you for this article.]]></description>
		<content:encoded><![CDATA[<p>I like this article. I use to work with matlab to calculate numbers but It&#8217;s also a fantastic tool to work with texts. The normal applications need to display some texts to improve their understanding.<br />
Thanks you for this article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah Wait Zaranek</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33232</link>
		<dc:creator>Sarah Wait Zaranek</dc:creator>
		<pubDate>Fri, 26 Oct 2012 13:37:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33232</guid>
		<description><![CDATA[@Jaromir -

Cool! 

I knew there was a nice way to do it with replacement, but I was torn because I wanted to focus first on regexp.  Thanks for sharing this - because ultimately it is probably the most efficent and cleanest way to do it.]]></description>
		<content:encoded><![CDATA[<p>@Jaromir -</p>
<p>Cool! </p>
<p>I knew there was a nice way to do it with replacement, but I was torn because I wanted to focus first on regexp.  Thanks for sharing this &#8211; because ultimately it is probably the most efficent and cleanest way to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah Wait Zaranek</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33230</link>
		<dc:creator>Sarah Wait Zaranek</dc:creator>
		<pubDate>Fri, 26 Oct 2012 13:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33230</guid>
		<description><![CDATA[@Aurélien -

Maybe those flashcards would be good to share on File Exchange.  A cheat sheet for people to hang in their offices might be really nice.]]></description>
		<content:encoded><![CDATA[<p>@Aurélien -</p>
<p>Maybe those flashcards would be good to share on File Exchange.  A cheat sheet for people to hang in their offices might be really nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaromir Benes</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33228</link>
		<dc:creator>Jaromir Benes</dc:creator>
		<pubDate>Thu, 25 Oct 2012 16:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33228</guid>
		<description><![CDATA[Yet another (and more compact) solution to the problem in Example #2


regexprep(locationNames,&#039;([A-Z].)[^A-Z]*&#039;,&#039;$1&#039;)


:)]]></description>
		<content:encoded><![CDATA[<p>Yet another (and more compact) solution to the problem in Example #2</p>
<p>regexprep(locationNames,&#8217;([A-Z].)[^A-Z]*&#8217;,'$1&#8242;)</p>
<p>:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah Zaranek</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33223</link>
		<dc:creator>Sarah Zaranek</dc:creator>
		<pubDate>Mon, 22 Oct 2012 20:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33223</guid>
		<description><![CDATA[@Sven - 

I chatted with development, and let them know of your request.  However, right now I think your way of doing it as &quot;easy&quot; as it can get.  There isn&#039;t anything that you are missing that I am aware of.  I will try and think about it some more and see if anything else pops into my brain.

Thanks,
Sarah]]></description>
		<content:encoded><![CDATA[<p>@Sven &#8211; </p>
<p>I chatted with development, and let them know of your request.  However, right now I think your way of doing it as &#8220;easy&#8221; as it can get.  There isn&#8217;t anything that you are missing that I am aware of.  I will try and think about it some more and see if anything else pops into my brain.</p>
<p>Thanks,<br />
Sarah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sven</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33220</link>
		<dc:creator>Sven</dc:creator>
		<pubDate>Sat, 20 Oct 2012 14:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33220</guid>
		<description><![CDATA[One question about using regexp in a strcmp-like way...

&gt;&gt; strCell = {&#039;first&#039;,&#039;second&#039;,&#039;third&#039;,&#039;fourth&#039;};

Using strcmp gives me a nice little logical mask that matches my criteria:

&gt;&gt; strcmp(&#039;third&#039;,strCell) % [0 0 1 0]

Let&#039;s say I had some criteria that needed regular expressions, and wanted to get a logical mask telling me which cells matched my criteria.

&gt;&gt; regexp(strCell,&#039;(f&#124;r)&#039;)

ans = 

    [1x2 double]    []    [4]    [1x2 double]

That, of course can be simplified a bit by using &#039;once&#039;:

&gt;&gt; regexp(strCell,&#039;(f&#124;r)&#039;,&#039;once&#039;)

ans = 

    [1]    []    [4]    [1]

But it&#039;s still not a logical mask. The only way I can think to make it one is to wrap it in a cellfun like this:

&gt;&gt; ~cellfun(@isempty, regexp(strCell,&#039;(f&#124;r)&#039;))

ans =

     1     0     1     1

Now, the above of course works just fine, but it just feels a touch awkward... Asking &quot;which strings match my pattern&quot; seems like a very simple (and very often asked!) question, but getting an answer to it involves the negation of a cellfun() call.

It feels like strcmp() is nice and straight forward, but adding the (relatively minor) addition of matching a pattern instead of an exact string takes a detour into logic and functions that makes the (notoriously confusing) regular expressions that much more tricky in MATLAB.

Thoughts?  Have I simply missed an obvious regexp() parameter that would make it behave how I want it to?]]></description>
		<content:encoded><![CDATA[<p>One question about using regexp in a strcmp-like way&#8230;</p>
<p>&gt;&gt; strCell = {&#8216;first&#8217;,'second&#8217;,'third&#8217;,'fourth&#8217;};</p>
<p>Using strcmp gives me a nice little logical mask that matches my criteria:</p>
<p>&gt;&gt; strcmp(&#8216;third&#8217;,strCell) % [0 0 1 0]</p>
<p>Let&#8217;s say I had some criteria that needed regular expressions, and wanted to get a logical mask telling me which cells matched my criteria.</p>
<p>&gt;&gt; regexp(strCell,&#8217;(f|r)&#8217;)</p>
<p>ans = </p>
<p>    [1x2 double]    []    [4]    [1x2 double]</p>
<p>That, of course can be simplified a bit by using &#8216;once&#8217;:</p>
<p>&gt;&gt; regexp(strCell,&#8217;(f|r)&#8217;,'once&#8217;)</p>
<p>ans = </p>
<p>    [1]    []    [4]    [1]</p>
<p>But it&#8217;s still not a logical mask. The only way I can think to make it one is to wrap it in a cellfun like this:</p>
<p>&gt;&gt; ~cellfun(@isempty, regexp(strCell,&#8217;(f|r)&#8217;))</p>
<p>ans =</p>
<p>     1     0     1     1</p>
<p>Now, the above of course works just fine, but it just feels a touch awkward&#8230; Asking &#8220;which strings match my pattern&#8221; seems like a very simple (and very often asked!) question, but getting an answer to it involves the negation of a cellfun() call.</p>
<p>It feels like strcmp() is nice and straight forward, but adding the (relatively minor) addition of matching a pattern instead of an exact string takes a detour into logic and functions that makes the (notoriously confusing) regular expressions that much more tricky in MATLAB.</p>
<p>Thoughts?  Have I simply missed an obvious regexp() parameter that would make it behave how I want it to?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aurélien</title>
		<link>http://blogs.mathworks.com/loren/2012/10/18/learning-to-love-regular-expressions/#comment-33217</link>
		<dc:creator>Aurélien</dc:creator>
		<pubDate>Fri, 19 Oct 2012 07:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=557#comment-33217</guid>
		<description><![CDATA[Like you, it is when I started playing CODY that I have noticed the power of regular expressions ... therefore I started writing some flashcards  to aid memorization !
Thanks for this article]]></description>
		<content:encoded><![CDATA[<p>Like you, it is when I started playing CODY that I have noticed the power of regular expressions &#8230; therefore I started writing some flashcards  to aid memorization !<br />
Thanks for this article</p>
]]></content:encoded>
	</item>
</channel>
</rss>
