RegexHighlighter for Yii

will add a Javascript based RegularExpression Syntaxhighlighter to Yii.
Download it here: EReSyntaxHighlighter.tar.gz
Cause it's fast forward I just describe the authors, options and implementation:

Authors

The colorization output is from: Steven Levithan
The dynamic hovering of brackets and so on is from: Jeff Roberson
The extension is from me - since both javacripts are MIT-License my extension is that too (also because MIT is realy great for it's simpleness)

Configuration

This extension mostly doesn't need configuration - but if you want:

$cssFile; // will overwrite the colorcss-file from syntaxhighlighter - look at the original cssfile what you can change
$className = 'regex'; // css-classname which should be highlighted
public $dynamic = true; // if the dynamichighlighter should be included or only coloroutput
public $functionName; // if you don't want autoloading that script and toggle it by a function

Implementation

Most important is that your regex lies within a container of class="regex" - then you just have to add the extension and it will work
But this example will show you the functionName configuration

<input type="button" onclick="javascrip:regexHighlight()" value="Highlight or remove Highlight of that regex" />
<br/>
<div class="regex" style="width:700px;">
	http:\/\/(((([a-zäöüß\d](([a-zäöüß\d]|-)*[a-zäöüß\d])?\.)*([a-zäöüß](([a-zäöüß\d]|-)*[a-zäöüß\d])?))|((\d{1,3})(\.\d{1,3}){3}))(:(\d{1,5}))?)(\/(((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2}))|[;:@&=])*)(\/((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2}))|[;:@&=])*))*)?)?(\?((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2})|(\/))|[;:@&=])*))?(#[a-z\d]?)?
</div>
<?php $this->widget('application.extensions.EReSyntaxHighlighter.EReSyntaxHighlighter', array('functionName'=>'regexHighlight'));?>

Example


http:\/\/(((([a-zäöüß\d](([a-zäöüß\d]|-)*[a-zäöüß\d])?\.)*([a-zäöüß](([a-zäöüß\d]|-)*[a-zäöüß\d])?))|((\d{1,3})(\.\d{1,3}){3}))(:(\d{1,5}))?)(\/(((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2}))|[;:@&=])*)(\/((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2}))|[;:@&=])*))*)?)?(\?((([a-z\d$\-_.+!*'(),]|(%[a-f\d]{2})|(\/))|[;:@&=])*))?(#[a-z\d]?)?