<?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>mitcho.com &#187; geshi</title>
	<atom:link href="http://mitcho.com/blog/tag/geshi/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 02:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Fixing Geshi on line 2132</title>
		<link>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/</link>
		<comments>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 15:15:44 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2233</guid>
		<description><![CDATA[I recently noticed that some of my blog posts, most notably my Templates in YARPP 3 article, was producing a PHP error: Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&#60; at offset 3 in /&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2132 This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently noticed that some of my blog posts, most notably my <a href="http://mitcho.com/blog/projects/yarpp-3-templates/">Templates in YARPP 3</a> article, was producing a PHP error:</p>

<blockquote>
  <p><b>Warning:</b> preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&lt; at offset 3 in <b>/&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on <b>line 2132</b></p>
</blockquote>

<p>This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A quick <a href="http://www.google.com/search?q=geshi+line+2132">google search for &#8220;geshi line 2132&#8221;</a> gives you over a thousand errors, so this seems to be common issue. <a href="http://qbnz.com/highlighter/">Geshi</a> is a fabulous and popular syntax highlighter and is the core component of the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax plugin</a> for WordPress.</p>

<p>I did some digging around and realized that the issue was with the compilation of this monstrosity of a regular expression, used (as far as I can tell) to identify PHP code snippets, for example the &lt;?php &#8230;&#160;?&gt; keywords:</p>


<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">/(?&lt;start&gt;&lt;\\?(?&gt;php\b)?)(?:
(?&gt;[^\&quot;'?\\/&lt;]+)|
\\?(?!&gt;)|
(?&gt;'(?&gt;[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|
(?&gt;\&quot;(?&gt;[^\&quot;\\\\]|\\\\\&quot;|\\\\\\\\|\\\\)*\&quot;)|
(?&gt;\\/\\*(?&gt;[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|
\\/\\/(?&gt;.*?$)|
\\/(?=[^*\\/])|
&lt;(?!&lt;&lt;)|
&lt;&lt;&lt;(?&lt;phpdoc&gt;\w+)\s.*?\s\k&lt;phpdoc&gt;
)*(?&lt;end&gt;\\?&gt;|\Z)/sm</pre></div></div>


<p>Not knowing exactly where to start in diagnosing this crazy expression, I simply disabled those &#8220;script delimiters&#8221; in the <code>geshi/php.php</code> file. The sections I commented out are lines 1080-1101. Now the script delimiters like <code>&amp;lt;?php</code> don&#8217;t get highlighted nicely, but I feel that&#8217;s a small price to pay for eliminating these errors. <a href="http://wordpress.org/support/topic/274864">Another solution for the WP-Syntax users</a> seems to be to downgrade to 0.9.4. Hopefully in the near future an update to Geshi will come out which fixes this issue once and for all.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

