Syntax highlighting for regexp

We all now regular expressions can be difficult to read, but it seems to
me like good syntax highlighting within a regexp would make the task
much easier. Even something as simple as a different color for control
characters vs literals. Is there an editor which does that?

Daniel

You can check out The Regex Coach [1] on Windows to help develop regular
expressions although it will not do syntax highlighting in your editor.

Dan

[1] http://www.weitz.de/regex-coach/

On Jan 12, 2008, at 21:12 , Daniel DeLorme wrote:

We all now regular expressions can be difficult to read

Well… I find your English harder to read than my regexps. :stuck_out_tongue:

On 13.01.2008 06:12, Daniel DeLorme wrote:

We all now regular expressions can be difficult to read, but it seems to
me like good syntax highlighting within a regexp would make the task
much easier. Even something as simple as a different color for control
characters vs literals. Is there an editor which does that?

I do not know one off the top of my head but various editors allow to
jump to matching brackets or highlight the expression between two
matching brackets. There is also option /x which allows for nice
regular expression formatting (including comments).

Kind regards

robert

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

On Jan 12, 2008, at 9:12 PM, Daniel DeLorme wrote:

We all now regular expressions can be difficult to read, but it
seems to me like good syntax highlighting within a regexp would
make the task much easier. Even something as simple as a different
color for control characters vs literals. Is there an editor which
does that?

Daniel

Daniel-

This is not exactly a regex syntax highlighter but it is one of the
coolest regex tools I’v ever seen. It’s an animated state machine
chart based on regexes you paste in and you can see the state machine
animate as it matches your string:

http://osteele.com/tools/reanimator/

Cheers-

On Jan 13, 6:12 am, Daniel DeLorme [email protected] wrote:

We all now regular expressions can be difficult to read, but it seems to
me like good syntax highlighting within a regexp would make the task
much easier. Even something as simple as a different color for control
characters vs literals. Is there an editor which does that?

Daniel

tkregexp : A Tcl Tk is available by Laurent Riesterer (salut
Laurent !) :
http://laurent.riesterer.free.fr/regexp/
There is little difference between advanced tcl versus ruby regexp
syntaxe, so perhaps is a good candidate for a TkRuby application
exemple ?

PS. for those interested, there is a discution on the list:
[email protected]

– Maurice

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs