<?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: XRegExp 0.2: Now With Named Capture</title>
	<atom:link href="http://blog.stevenlevithan.com/archives/xregexp-named-capture/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Thu, 11 Mar 2010 18:49:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Julian Turner</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture/comment-page-1#comment-947</link>
		<dc:creator>Julian Turner</dc:creator>
		<pubDate>Tue, 31 Jul 2007 11:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-named-capture#comment-947</guid>
		<description>I like the idea of the &quot;$&quot; prefix and I think I&#039;ll go with that.

&gt;Use &lt; and &gt; to avoid the issue.)

Yes, I did that the second time; so as you noted, there was something wrong with the first one that just seem to affect the display of all subsequent comments.</description>
		<content:encoded><![CDATA[<p>I like the idea of the &#8220;$&#8221; prefix and I think I&#8217;ll go with that.</p>
<p>&gt;Use &amp;lt; and &amp;gt; to avoid the issue.)</p>
<p>Yes, I did that the second time; so as you noted, there was something wrong with the first one that just seem to affect the display of all subsequent comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture/comment-page-1#comment-937</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 31 Jul 2007 01:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-named-capture#comment-937</guid>
		<description>Hi Julian,

I can understand the desire for capture names to better stand out, but I don&#039;t currently plan to support multiple variable name identifiers. For XRegExp&#039;s named capture syntax, I have copied the most commonly used .NET style as closely as possible. If I added support for alternative syntax in the future, it would probably only be to copy existing implementations from other regex libraries.

One thing that might help make the names stand out is prefixing them with &quot;&lt;code&gt;$&lt;/code&gt;&quot; (e.g., &lt;code&gt;&quot;(&lt;$CDATASectionTag&gt;&lt;!\\[CDATA\\[)&quot;&lt;/code&gt;). If you think that helps, it has a couple things going for it: It should work with XRegExp as is, and it keeps with the &lt;code&gt;$&lt;em&gt;n&lt;/em&gt;&lt;/code&gt; idiom for backreferences.

If you want to change your personal copy of XRegExp to use a different capture name identifier, it should just require a simple change near the end of the &lt;code&gt;XRegExp._re.capturingGroup&lt;/code&gt; regex. However, note that in later versions, the existing regex might be slightly tweaked or the implementation changed altogether (less likely). Also note that certain characters or sequences would break regexes. E.g., the &quot;&lt;code&gt;#&lt;/code&gt;&quot; characters used in your second example would turn most of your regex into a comment if you used the &quot;&lt;code&gt;x&lt;/code&gt;&quot; modifier.

&lt;span class=&quot;small&quot;&gt;(BTW, I fixed the regexes in your above comment using the code provided in your second try. Sorry about the code stripping &#8230; use &lt;code&gt;&lt;&lt;/code&gt; and &lt;code&gt;&gt;&lt;/code&gt; to avoid the issue.)&lt;/span&gt;</description>
		<content:encoded><![CDATA[<p>Hi Julian,</p>
<p>I can understand the desire for capture names to better stand out, but I don&#8217;t currently plan to support multiple variable name identifiers. For XRegExp&#8217;s named capture syntax, I have copied the most commonly used .NET style as closely as possible. If I added support for alternative syntax in the future, it would probably only be to copy existing implementations from other regex libraries.</p>
<p>One thing that might help make the names stand out is prefixing them with &#8220;<code>$</code>&#8221; (e.g., <code>"(&lt;$CDATASectionTag&gt;&lt;!\\[CDATA\\[)"</code>). If you think that helps, it has a couple things going for it: It should work with XRegExp as is, and it keeps with the <code>$<em>n</em></code> idiom for backreferences.</p>
<p>If you want to change your personal copy of XRegExp to use a different capture name identifier, it should just require a simple change near the end of the <code>XRegExp._re.capturingGroup</code> regex. However, note that in later versions, the existing regex might be slightly tweaked or the implementation changed altogether (less likely). Also note that certain characters or sequences would break regexes. E.g., the &#8220;<code>#</code>&#8221; characters used in your second example would turn most of your regex into a comment if you used the &#8220;<code>x</code>&#8221; modifier.</p>
<p><span class="small">(BTW, I fixed the regexes in your above comment using the code provided in your second try. Sorry about the code stripping &hellip; use <code>&amp;lt;</code> and <code>&amp;gt;</code> to avoid the issue.)</span></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Turner</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture/comment-page-1#comment-925</link>
		<dc:creator>Julian Turner</dc:creator>
		<pubDate>Mon, 30 Jul 2007 16:18:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-named-capture#comment-925</guid>
		<description>Hi

I am writing some XML regular expressions and I have been thinking about how to get the named captures to stand out a bit depending on the patterns you are matching.

I don&#039;t know if it is worth giving different options to the user. In my case I quite like either &lt;code&gt;&lt;&lt;Name&gt;&gt;&lt;/code&gt; or &lt;code&gt;#Name#&lt;/code&gt; which is visible against that background.

E.g.

&lt;code&gt;var xml_CharData = &quot;(&lt;&lt;CDATASectionTag&gt;&gt;&lt;!\\[CDATA\\[&quot; + &quot;(&lt;&lt;CDATASectionContents&gt;&gt;(&quot; + xml_CharNotOpenBracket + &quot;&#124;&quot; + &quot;[\]](?!\\]&gt;)&quot; + &quot;)*)&quot; + &quot;]]&gt;)&quot;;&lt;/code&gt;

&lt;code&gt;var xml_CharData = &quot;(#CDATASectionTag#&lt;!\\[CDATA\\[&quot; + &quot;(#CDATASectionContents#(&quot; + xml_CharNotOpenBracket + &quot;&#124;&quot; + &quot;[\]](?!\\]&gt;)&quot; + &quot;)*)&quot; + &quot;]]&gt;)&quot;;&lt;/code&gt;

Regards

Julian</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I am writing some XML regular expressions and I have been thinking about how to get the named captures to stand out a bit depending on the patterns you are matching.</p>
<p>I don&#8217;t know if it is worth giving different options to the user. In my case I quite like either <code>&lt;&lt;Name&gt;&gt;</code> or <code>#Name#</code> which is visible against that background.</p>
<p>E.g.</p>
<p><code>var xml_CharData = &#34;(&lt;&lt;CDATASectionTag&gt;&gt;&lt;!\\[CDATA\\[&#34; + &#34;(&lt;&lt;CDATASectionContents&gt;&gt;(&#34; + xml_CharNotOpenBracket + &#34;|&#34; + &#34;[\]](?!\\]&gt;)&#34; + &#34;)*)&#34; + &#34;]]&gt;)&#34;;</code></p>
<p><code>var xml_CharData = &#34;(#CDATASectionTag#&lt;!\\[CDATA\\[&#34; + &#34;(#CDATASectionContents#(&#34; + xml_CharNotOpenBracket + &#34;|&#34; + &#34;[\]](?!\\]&gt;)&#34; + &#34;)*)&#34; + &#34;]]&gt;)&#34;;</code></p>
<p>Regards</p>
<p>Julian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sodapunk</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture/comment-page-1#comment-666</link>
		<dc:creator>sodapunk</dc:creator>
		<pubDate>Fri, 20 Jul 2007 09:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-named-capture#comment-666</guid>
		<description>Thanks for this, it&#039;s very helpful! just learning regex in javascript right now</description>
		<content:encoded><![CDATA[<p>Thanks for this, it&#8217;s very helpful! just learning regex in javascript right now</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Extended regular expression support for JavaScript &#187; StickBlog</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-named-capture/comment-page-1#comment-370</link>
		<dc:creator>Extended regular expression support for JavaScript &#187; StickBlog</dc:creator>
		<pubDate>Mon, 09 Jul 2007 15:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-named-capture#comment-370</guid>
		<description>[...] XRegExp is an interesting attempt to add some extra features to regular expressions in JavaScript. I particularly like the &#8216;named capture&#8217; feature (which I only recently encountered in .Net), which returns matches in named groups. [...]</description>
		<content:encoded><![CDATA[<p>[...] XRegExp is an interesting attempt to add some extra features to regular expressions in JavaScript. I particularly like the &#8216;named capture&#8217; feature (which I only recently encountered in .Net), which returns matches in named groups. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
