Alien-CodePress
view release on metacpan or search on metacpan
cp/codepress/languages/perl.js view on Meta::CPAN
* CodePress regular expressions for Perl syntax highlighting
* By J. Nick Koston
*/
// Perl
Language.syntax = [
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
{ input : /([\$\@\%][\w\.]*)/g, output : '<a>$1</a>' }, // vars
{ input : /(sub\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
{ input : /\b(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|do|dump|each|else|elsif|endgrent|endhostent|endnetent|endprotoent|e...
{ input : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars
{ input : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments
]
Language.snippets = []
Language.complete = [
{ input : '\'',output : '\'$0\'' },
{ input : '"', output : '"$0"' },
{ input : '(', output : '\($0\)' },
cp/codepress/languages/php.js view on Meta::CPAN
Language.syntax = [
{ input : /(<[^!\?]*?>)/g, output : '<b>$1</b>' }, // all tags
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<ins>$1</ins><ins>$2</ins><ins>$3</ins>' }, // script tags
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
{ input : /(<\?)/g, output : '<strong>$1' }, // <?.*
{ input : /(\?>)/g, output : '$1</strong>' }, // .*?>
{ input : /(<\?php|<\?=|<\?|\?>)/g, output : '<cite>$1</cite>' }, // php tags
{ input : /(\$[\w\.]*)/g, output : '<a>$1</a>' }, // vars
{ input : /\b(false|true|and|or|xor|__FILE__|exception|__LINE__|array|as|break|case|class|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|globa...
{ input : /([^:])\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // php comments //
{ input : /([^:])#(.*?)(<br|<\/P)/g, output : '$1<i>#$2</i>$3' }, // php comments #
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }, // php comments /* */
{ input : /(<!--.*?-->.)/g, output : '<big>$1</big>' } // html comments
]
Language.snippets = [
{ input : 'if', output : 'if($0){\n\t\n}' },
{ input : 'ifelse', output : 'if($0){\n\t\n}\nelse{\n\t\n}' },
{ input : 'else', output : '}\nelse {\n\t' },
( run in 0.674 second using v1.01-cache-2.11-cpan-49f99fa48dc )