<?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>Flagrant Badassery &#187; Project Releases</title>
	<atom:link href="http://blog.stevenlevithan.com/category/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Mon, 05 Jul 2010 20:27:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Regex Syntax Highlighter</title>
		<link>http://blog.stevenlevithan.com/archives/regex-syntax-highlighter</link>
		<comments>http://blog.stevenlevithan.com/archives/regex-syntax-highlighter#comments</comments>
		<pubDate>Mon, 05 Jul 2010 08:55:36 +0000</pubDate>
		<dc:creator>Steven Levithan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Project Releases]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=381</guid>
		<description><![CDATA[Do you regularly post regular expressions online? Have you seen the regex syntax highlighting in RegexPal, RegexBuddy, or on my blog (example), and wanted to apply it to your own websites?

Prompted by blog reader Mark McDonnell, I've extracted the regex syntax highlighting engine built into RegexPal and made it into its own library, unimaginatively named [...]]]></description>
			<content:encoded><![CDATA[<p>Do you regularly post regular expressions online? Have you seen the regex syntax highlighting in <a href="http://regexpal.com/">RegexPal</a>, <a href="http://www.regexbuddy.com/cgi-bin/affref.pl?aff=SteveL">RegexBuddy</a>, or on my blog (<a href="http://blog.stevenlevithan.com/archives/multi-attr-capture">example</a>), and wanted to apply it to your own websites?</p>

<p>Prompted by blog reader <a href="http://www.integralist.co.uk/">Mark McDonnell</a>, I've extracted the regex syntax highlighting engine built into RegexPal and made it into its own library, unimaginatively named <a href="http://stevenlevithan.com/regex/syntaxhighlighter/"><strong>JavaScript Regex Syntax Highlighter</strong></a>. When combined with the provided CSS, this 1.6 KB self-contained JavaScript file can be used, for instance, to automatically apply regex syntax highlighting to any HTML element with the "<code>regex</code>" class. You can see an example of doing just that on my quick and dirty <a href="http://stevenlevithan.com/regex/syntaxhighlighter/">test page</a>.</p>

<div style="border:1px solid #d3d3d3; background:#f6f6f6; padding:5px; margin:15px 0;">
<p style="text-align:center; margin:0;">Highlighting example:<br />
<code class="regex">&lt;table<b>\b</b><i>[^&gt;]</i><b>*</b>&gt;<b class="g1">(?:</b><b class="g2">(?=</b><b class="g3">(</b><i>[^&lt;]</i><b>+</b><b class="g3">)</b><b class="g2">)</b><b>\1</b><b class="g1">|</b>&lt;<b class="g2">(?!</b>table<b>\b</b><i>[^&gt;]</i><b>*</b>&gt;<b class="g2">)</b><b class="g1">)</b><b class="g1">*?</b>&lt;/table&gt;</code></p>
</div>

<p>Although the library is simple (there's just one function to call), the syntax highlighting is pretty advanced and handles all valid JavaScript regex syntax and errors (with errors highlighted in red). An example of its advanced highlighting support is that it knows, based on the context, whether <code>\10</code> is backreference 10, backreference 1 followed by a literal zero, octal character index 10, or something else altogether due to its position in the surrounding pattern. Speaking of octal escapes (which are de facto browser extensions; not part of the spec.), they are correctly highlighted according to their subtle differences inside and outside character classes (outside of character classes only, octals can include a fourth digit if the leading digit is a zero).</p>

<p>As far as I'm aware, this is the first JavaScript library for highlighting regex syntax, with or without the level of completeness included here. For people who might feel inclined to use or improve upon my work, I've made the licensing as permissive as possible to avoid getting in your way. RegexPal is already open source under the GNU LGPL 3.0 License, but this new library is released under the MIT License. If you plan to customize or help upgrade this code, note that it could probably use a bit of an overhaul (it's ripped from RegexPal with minimal modification), and might <em>require</em> an overhaul if you want to cleanly add support for additional regex flavors. Another nifty feature I plan to eventually add is explanatory <code>title</code> attributes for each element in the returned HTML, which might be particularly helpful for deciphering any highlighted errors or warnings.</p>

<p>Let me know if this library is useful for you, or if there are any other features you'd like to see added or changed. Thanks!</p>

<p>Link: <a href="http://stevenlevithan.com/regex/syntaxhighlighter/"><strong>JavaScript Regex Syntax Highlighter</strong></a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stevenlevithan.com/archives/regex-syntax-highlighter/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Five Free Copies of Upcoming O&#8217;Reilly Book &#8216;High Performance JavaScript&#8217;</title>
		<link>http://blog.stevenlevithan.com/archives/high-performance-javascript</link>
		<comments>http://blog.stevenlevithan.com/archives/high-performance-javascript#comments</comments>
		<pubDate>Wed, 03 Feb 2010 07:57:34 +0000</pubDate>
		<dc:creator>Steven Levithan</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Project Releases]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[regex performance]]></category>
		<category><![CDATA[schwag]]></category>

		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=243</guid>
		<description><![CDATA[
Update (2010-02-25): This contest is now closed.




Last year, Yahoo! engineer and all-around JavaScript badass Nicholas Zakas asked if I was interested in writing a chapter for a new book on JavaScript performance that he was working on. I agreed, and that book, High Performance JavaScript, is now available for preorder at Amazon and other fine [...]]]></description>
			<content:encoded><![CDATA[<div class="update">
<p><strong>Update (2010-02-25):</strong> This contest is now closed.</p>
</div>

<a href="http://www.amazon.com/dp/059680279X/?tag=slfb-20"><img class="right" src="http://blog.stevenlevithan.com/assets/images/hpjs_cover_s.png" alt="Book cover: High Performance JavaScript" width="180" height="236"></a>

<p>Last year, Yahoo! engineer and all-around JavaScript badass <a href="http://www.nczonline.net/">Nicholas Zakas</a> asked if I was interested in writing a chapter for a new book on JavaScript performance that he was working on. I agreed, and that book, <strong><em><a href="http://www.amazon.com/dp/059680279X/?tag=slfb-20">High Performance JavaScript</a></em></strong>, is now available for preorder at Amazon and other fine book retailers.</p>

<p>In addition to the wide-ranging content by Nicholas and a chapter on string and regular expression performance by yours truly, chapters were also contributed by an awesome lineup of JavaScript performance gurus: <a href="http://techfoolery.com/">Ross Harmes</a>, <a href="http://www.julienlecomte.net/blog/">Julien Lecomte</a>, <a href="http://www.phpied.com/">Stoyan Stefanov</a>, and Matt Sweeney. This book is unique in its laser-focus on optimizing the performance of your JavaScript applications, and covers many advanced topics in the process. The chapter on strings and regular expressions provides what I think is easily the most in-depth coverage of cross-browser JavaScript regex performance currently available.</p>

<p>Here's the list of chapters:</p>

<ol>
	<li>Loading and Execution</li>
	<li>Data Access</li>
	<li>DOM Scripting <em>(Stoyan Stefanov)</em></li>
	<li>Algorithms and Flow Control</li>
	<li>Strings and Regular Expressions <em>(Steven Levithan)</em></li>
	<li>Responsive Interfaces</li>
	<li>Ajax <em>(Ross Harmes)</em></li>
	<li>Programming Practices</li>
	<li>Build and Deployment <em>(Julien Lecomte)</em></li>
	<li>Tools <em>(Matt Sweeney)</em></li>
</ol>

<p>To celebrate the completion of this book, <del>I'm giving away three copies.</del> <ins>O'Reilly Media increased the offer to five books!</ins> All you need to do is comment on this post by February 24<sup>th</sup>, and I'll pick five people to send a copy to as soon as it's released (Amazon says March 15<sup>th</sup>). If you prefer, I'd be happy to send you a copy of <em><a href="http://www.amazon.com/dp/0596520689/?tag=slfb-20">Regular Expressions Cookbook</a></em> instead (please note which book you want in your comment). Four winners will be chosen at random from the pool of unique commenters (I'll be tracking IPs), and the fifth based on the reason given for why you want a copy.</p>

<p>Make sure to include your email address in the comment form, since I'll need it to contact you if you're selected (your email address won't be used for any other purpose). Good luck, and congratulations to Nicholas Zakas and all the other authors on completing a fantastic new book!</p>

<p><em>Edit (2010-02-05):</em> My blog has been offline more often than not for the first two days after posting this, and many people have reported that they were unable to post a comment. I apologize for the screw-up&mdash;my blog is now on a different server, and the problems should be resolved. Please try again!</p>

<p><em>Edit (2010-02-08):</em> O'Reilly Media kindly offered to pick up the tab for this giveaway, and increased the winnings to five books!</p>

<p><em>Edit (2010-02-09):</em> Nicholas Zakas posted more information about <em>High Performance JavaScript</em> on his blog: <a href="http://www.nczonline.net/blog/2010/02/09/announcing-high-performance-javascript/">Announcing High Performance JavaScript</a>.</p>

<p><em>Edit (2010-02-25):</em> This contest is now closed. Winners will be announced here shortly.</p>

<p id="hpjs-winners"><em>Edit (2010-03-03):</em> Following are the <strong>winners of this giveaway</strong> (the first four were chosen randomly):</p>

<ol>
	<li><a href="/archives/high-performance-javascript#comment-47516">David Henderson</a></li>
	<li><a href="/archives/high-performance-javascript#comment-47686">Daniel Trebbien</a></li>
	<li><a href="/archives/high-performance-javascript#comment-47179">Lea Verou</a></li>
	<li><a href="/archives/high-performance-javascript#comment-47033">Stefan "schnalle" Schallerl</a></li>
	<li><a href="/archives/high-performance-javascript#comment-47099">Adam Crabtree</a></li>
</ol>

<p>No. 5 Adam Crabtree, who wants to review the book and share it with members of the <a href="http://meetup.com/DallasJS">DallasJS Meetup Group</a>, wins the nonrandom drawing for the best reason to win a copy. Runners up for this selection were <a href="/archives/high-performance-javascript#comment-47000">Yoav</a>, who promised to donate the book to a high school library after he's done with it; <a href="/archives/high-performance-javascript#comment-47079">Nick Carter</a>, who threatened me with his wrath if he doesn't win (I'll have to endure); <a href="/archives/high-performance-javascript#comment-47095">Paul Irish</a>, who kindly offered to have my last name corrected (to that of a sea monster) in exchange for winning; <a href="/archives/high-performance-javascript#comment-47487">Alexei</a>, a technical editor of a couple of Nicholas Zakas's previous books who'd like to know how many errors this one contains; and <a href="/archives/high-performance-javascript#comment-48183">Marcel Korpel</a>, who wants to improve his users' health by reducing the "headaches, general stress and insomnia" they suffer while waiting on his websites. <img src='http://blog.stevenlevithan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>The winners have been informed by email about how to collect their prize. Thanks to everyone for playing!</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stevenlevithan.com/archives/high-performance-javascript/feed</wfw:commentRss>
		<slash:comments>278</slash:comments>
		</item>
		<item>
		<title>XRegExp 1.0</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-1-0</link>
		<comments>http://blog.stevenlevithan.com/archives/xregexp-1-0#comments</comments>
		<pubDate>Wed, 24 Jun 2009 02:29:28 +0000</pubDate>
		<dc:creator>Steven Levithan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Project Releases]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-1-0</guid>
		<description><![CDATA[After stalling for nearly a year, I've finally released XRegExp 1.0, the next generation of my JavaScript regular expression library. Although it doesn't add support for lookbehind (as I've previously suggested) due to what would amount to significant inherent limitations, it fixes a couple bugs, corrects even more cross-browser regex inconsistencies, and adds a suite [...]]]></description>
			<content:encoded><![CDATA[<p>After stalling for nearly a year, I've finally released <a href="http://xregexp.com">XRegExp 1.0</a>, the next generation of my JavaScript regular expression library. Although it doesn't add support for lookbehind (as I've previously suggested) due to what would amount to significant inherent limitations, it fixes a couple bugs, corrects even more cross-browser regex inconsistencies, and adds a suite of new regular expression functions and methods that make writing regex-intensive JavaScript applications easier than ever. One of these new functions, <code>XRegExp.addToken</code>, fundamentally changes XRegExp's implementation and allows you to easily create your own XRegExp plugins.</p>

<p>Here's XRegExp's abbreviated feature list from the brand new <a href="http://xregexp.com"><strong>xregexp.com</strong></a> (which includes extensive documentation and code examples):</p>

<ul>
	<li>Adds <a href="http://xregexp.com/syntax/">new regex and replacement text syntax</a>, including comprehensive support for <a href="http://xregexp.com/syntax/#namedCapture">named capture</a>.</li>
	<li>Adds two <a href="http://xregexp.com/flags/">new regex flags</a>: <code>s</code>, to make <a href="http://xregexp.com/flags/#singleline">dot match all</a> characters (aka <em>singleline</em> mode), and <code>x</code>, for <a href="http://xregexp.com/flags/#extended">free-spacing</a> and comments (aka <em>extended</em> mode).</li>
	<li>Provides a suite of <a href="http://xregexp.com/api/">12 functions and methods</a> that make complex regex processing a breeze.</li>
	<li>Automagically fixes the most commonly encountered <a href="http://xregexp.com/cross_browser/">cross-browser inconsistencies</a> in regex behavior and syntax.</li>
	<li>Lets you easily <a href="http://xregexp.com/plugins/">create and use plugins</a> that add new syntax and flags to XRegExp's regular expression language.</li>
</ul>

<p>The full list of changes can be seen in the <a href="http://xregexp.com/history/">changelog</a>. Please let me know if you find any bugs or have any suggestions for the library. I'd also love to hear about projects or sites that are using XRegExp (I've got a few listed on the XRegExp homepage now).</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stevenlevithan.com/archives/xregexp-1-0/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Regular Expressions Cookbook is Out</title>
		<link>http://blog.stevenlevithan.com/archives/regex-cookbook-published</link>
		<comments>http://blog.stevenlevithan.com/archives/regex-cookbook-published#comments</comments>
		<pubDate>Fri, 05 Jun 2009 01:51:14 +0000</pubDate>
		<dc:creator>Steven Levithan</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Project Releases]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://blog.stevenlevithan.com/?p=190</guid>
		<description><![CDATA[As of today, Regular Expressions Cookbook (written by Jan Goyvaerts and me, and published by O'Reilly Media) is listed as In Stock on Amazon.com and other fine bookstores. The book covers seven regular expression flavors (.NET, Java, JavaScript, Perl, PCRE, Python, and Ruby) and eight programming languages (C#, Java, JavaScript, Perl, PHP, Python, Ruby, and [...]]]></description>
			<content:encoded><![CDATA[<p>As of today, <em><a href="http://www.amazon.com/dp/0596520689/?tag=slfb-20">Regular Expressions Cookbook</a></em> (written by Jan Goyvaerts and me, and published by O'Reilly Media) is listed as <em>In Stock</em> on Amazon.com and other fine bookstores. The book covers seven regular expression flavors (.NET, Java, JavaScript, Perl, PCRE, Python, and Ruby) and eight programming languages (C#, Java, JavaScript, Perl, PHP, Python, Ruby, and VB.NET). It's targeted at people with regex skills from beginner to upper intermediate, and there's a fair amount of information in there even for people who already consider themselves regex experts. For those who'd like to know more, Jan has a good <a href="http://regexguru.com/2009/05/regular-expressions-cookbook-has-been-published/">summary on his blog</a>, and here is <a href="http://press.oreilly.com/pub/pr/2314">O'Reilly's press release</a> for the book.</p>

<p>Don't forget to <a href="http://www.amazon.com/dp/0596520689/?tag=slfb-20">pick up a copy of your very own</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stevenlevithan.com/archives/regex-cookbook-published/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>XRegExp 0.5 Released!</title>
		<link>http://blog.stevenlevithan.com/archives/xregexp-0-5</link>
		<comments>http://blog.stevenlevithan.com/archives/xregexp-0-5#comments</comments>
		<pubDate>Mon, 21 Apr 2008 00:43:35 +0000</pubDate>
		<dc:creator>Steven Levithan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Project Releases]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[xregexp]]></category>

		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/xregexp-0-5</guid>
		<description><![CDATA[
Update: This version of XRegExp is outdated. See XRegExp.com for the latest, greatest version.


If you haven't seen the prior versions, XRegExp is an MIT-licensed JavaScript library that provides an augmented, cross-browser implementation of regular expressions, including support for additional modifiers and syntax. Several convenience methods and a new, powerful recursive-construct parser that uses regex delimiters [...]]]></description>
			<content:encoded><![CDATA[<div class="update">
<p><strong>Update:</strong> This version of XRegExp is outdated. See <a href="http://xregexp.com/"><strong>XRegExp.com</strong></a> for the latest, greatest version.</p>
</div>

<p>If you haven't seen the prior versions, <a href="http://xregexp.com/">XRegExp</a> is an MIT-licensed JavaScript library that provides an augmented, cross-browser implementation of regular expressions, including support for additional modifiers and syntax. Several convenience methods and a new, powerful recursive-construct parser that uses regex delimiters are also included.</p>

<p>Here's what you get beyond the standard JavaScript regex features:</p>

<ul>
	<li>Added regex syntax:
		<ul>
			<li>Comprehensive named capture support. <strong class="small">(Improved)</strong></li>
			<li>Comment patterns: <code>(?#â€¦)</code>. <strong class="small">(New)</strong></li>
		</ul>
	</li>
	<li>Added regex modifiers (flags):
		<ul>
			<li><code>s</code> (<em>singleline</em>), to make dot match all characters including newlines.</li>
			<li><code>x</code> (<em>extended</em>), for free-spacing and comments.</li>

		</ul>
	</li>
	<li>Added awesome:
		<ul>
			<li>Reduced cross-browser inconsistencies. <strong class="small">(More)</strong></li>
			<li>Recursive-construct parser with regex delimiters. <strong class="small">(New)</strong></li>
			<li>An easy way to cache and reuse regex objects. <strong class="small">(New)</strong></li>
			<li>The ability to safely embed literal text in your regex patterns. <strong class="small">(New)</strong></li>
			<li>A method to add modifiers to existing regex objects.</li>
			<li>Regex <code>call</code> and <code>apply</code> methods, which make generically working with functions and regexes easier. <strong class="small">(New)</strong></li>
		</ul>
	</li>
</ul>

<p>All of this can be yours for the low, low price of 2.4 KB. <img src="http://blog.stevenlevithan.com/wp-includes/images/smilies/icon_smile.gif" alt="smile" /> Version 0.5 also introduces <a href="http://xregexp.com/">extensive documentation and code examples</a>.</p>

<p>If you're using a previous version, note that there are a few non-backward compatible changes for the sake of strict ECMA-262 Edition 3 compliance and compatibility with upcoming ECMAScript 4 changes.</p>

<ul>
	<li>The <code>XRegExp.overrideNative</code> function has been removed, since it is no longer possible to override native constructors in Firefox 3 or ECMAScript 4 (as proposed).</li>
	<li>Named capture syntax has been changed from <code>(&lt;name&gt;&hellip;)</code> to <code>(?&lt;name&gt;&hellip;)</code>, which is the standard in most regex libraries and under consideration for ES4. Named capture is now always available, and does not require the <code>k</code> modifier.</li>
	<li>Due to cross-browser compatibility issues, previous versions enforced that a leading, unescaped <code>]</code> within a character class was treated as a literal character, which is how things work in most regex flavors. XRegExp now follows ECMA-262 Edition 3 on this point. <code>[]</code> is an empty set and never matches (this is enforced in all browsers).</li>
</ul>

<p>Get it while it's hot! Check out the new <a href="http://xregexp.com/">XRegExp documentation</a> and <a href="http://xregexp.com/old/xregexp_0.5.2.js">source code</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.stevenlevithan.com/archives/xregexp-0-5/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
