<?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>Some TeX Developments &#187; regex</title>
	<atom:link href="http://www.texdev.net/tag/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.texdev.net</link>
	<description>Coding in the TeX world</description>
	<lastBuildDate>Sun, 22 Jan 2012 10:34:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Regular expressions</title>
		<link>http://www.texdev.net/2009/05/30/regular-expressions/</link>
		<comments>http://www.texdev.net/2009/05/30/regular-expressions/#comments</comments>
		<pubDate>Sat, 30 May 2009 16:27:38 +0000</pubDate>
		<dc:creator>Joseph Wright</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LuaTeX]]></category>
		<category><![CDATA[pdfTeX]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[TeXworks]]></category>
		<category><![CDATA[XeTeX]]></category>

		<guid isPermaLink="false">http://www.texdev.net/?p=302</guid>
		<description><![CDATA[Regular expressions are very popular as a quick and powerful way to carry out searches and replacements in text of all sorts. Traditionally, TeX handles tokens and not strings or characters. This means that doing regex searches using TeX82 is pretty much impossible. To solve this, recent versions of pdfTeX adds the \pdfmatch primitive to [...]]]></description>
			<content:encoded><![CDATA[<p>Regular expressions are very popular as a quick and powerful way to carry out searches and replacements in text of all sorts. Traditionally, TeX handles tokens and not strings or characters. This means that doing regex searches using TeX82 is pretty much impossible. To solve this, recent versions of <a title="pdfTeX" href="http://www.pdftex.org">pdfTeX</a> adds the <code>\pdfmatch</code> primitive to allow real <em>string </em>matching inside TeX. The <a title="LuaTeX homepage" href="http://www.luatex.org">LuaTeX</a> team have decided not to take all of the existing “new” primitives forward from pdfTeX, and as I understand it  <code>\pdfmatch</code> will not be implemented in LuaTeX. However, Lua itself has regular expression matching, and so the functionality will still be around.</p>
<p>I&#8217;ve recently talked about <a href="http://www.texdev.net/2009/05/17/more-on-xetex-primitives/">adding new primitives to XeTeX</a>, and you&#8217;ll see that <code>\pdfmatch</code> was not on the list for adding to <a title="XeTeX" href="http://www.tug.org/xetex/">XeTeX</a>. The reason is that a XeTeX implementation would have to be slightly different from pdfTeX, as it is natively UTF-8, but also would be different to LuaTeX, as it would still be a TeX primitive and not a Lua function. So here “the prize wasn&#8217;t worth the winning”, in my opinion. As it is,  using <code>\pdfmatch</code> is not widespread, and the idea of having three different regex methods inside TeX didn&#8217;t seem like a great idea!</p>
<p>Talking of regex implementations, I&#8217;ve been reading <a title="Programming in Lua" href="http://www.amazon.com/exec/obidos/ASIN/8590379825/lua-home-20"><em>Programming in Lua</em></a>, and also working with <a title="TeXworks: lowering the entry barrier to the TeX world" href="http://www.tug.org/texworks">TeXworks</a> to try to get syntax highlighting the way I like it. Both systems are slightly different, and it seems both are different from the <a title="Perl" href="http://www.perl.org">Perl</a> implementation. It seems that every time you want to use a regex system you have to read the manual to see which things are different from every other implementation!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.texdev.net/2009/05/30/regular-expressions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

