From: Daniel DeLorme Date: 2008-01-14T01:18:08+09:00 Subject: Re: Syntax highlighting for regexp for jEdit --------------060706000402070901000507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks for the answers but what I was looking for what really syntax highlighting within my editor, not a visual tool for building regex. I don't know if this is a common view, but I find regex are usually easier to write than to read. After messing around a little, I managed to find how to hack jEdit's syntax highlighting for ruby, so I went and added what I wanted. I'm decently pleased with the results. I'm attaching the resulting syntax file, in case anyone is interested. Based on jEdit 4.2, it should replace the file /usr/share/jedit/modes/ruby.xml Daniel --------------060706000402070901000507 Content-Type: text/xml; name="ruby.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby.xml" =begin =end @ " " ' ' %Q?\( ) %q\( ) %Q?\{ } %q\{ } %Q?\[ ] %q\[ ] %Q?< > %q< > %Q([^[:alnum:]]) $1 %q([^[:alnum:]]) $1 %([^[:alnum:][:space:]]) $1 %W\( ) %w\( ) %W\{ } %w\{ } %W\[ ] %w\[ ] %W< > %w< > %W([^[:alnum:][:space:]]) $1 %w([^[:alnum:][:space:]]) $1 <<-?"([[:graph:]]+)" $1 <<-?'([[:graph:]]+)' $1 <<-?([A-Za-z_]+) $1 ` ` %x\( ) %x\{ } %x\[ ] %x< > %x([^[:alnum:][:space:]]) $1 %r\( ) %r\{ } %r\[ ] %r< > %r([^[:alnum:][:space:]]) $1 \(/ / #{ } # \$-[0adFiIKlpvw](?![[:alnum:]_]) \$[0-9!@&\+`'=~/\\,\.;<>_\*"\$\?\:F](?![[:alnum:]_]) defined? include(?![[:alnum:]_\?]) { } ( ) :: === = >> << <= + - / ** * % & | ! > < ^ ~ ... .. ] [ ? :[[:alpha:]_][[:alnum:]_]* : BEGIN END alias begin break case class def do else elsif end ensure for if in module next redo rescue retry return then undef unless until when while yield load require and not or false nil self super true $defout $deferr $stderr $stdin $stdout $DEBUG $FILENAME $LOAD_PATH $SAFE $VERBOSE __FILE__ __LINE__ ARGF ARGV ENV DATA FALSE NIL RUBY_PLATFORM RUBY_RELEASE_DATE RUBY_VERSION STDERR STDIN STDOUT SCRIPT_LINES__ TOPLEVEL_BINDING TRUE #{ } #@@ #@ #$ #{ } #@@ #@ #$ #{ } #@@ #@ #$ ^ $ . \\[wWsSdD] \\[AZzGgbB] * + ? { } | \(\?[!>:] ) (?# ) ( ) \\([0-9]{3}) \\[0-9]{1,2} \[\^? ] \\. #{ } #@@ #@ #$ - --------------060706000402070901000507--