Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

JEdit's RE Tester. (boo)

by boo_radley (Parson)
on Apr 10, 2002 at 05:27 UTC ( [id://157962]=note: print w/replies, xml ) Need Help??


in reply to Re: Regular Expression GUI?
in thread Regular Expression GUI?

JEdit is a nifty editor, but the engine that JEdit's regex tool (RE Tester) employs has several differences from perl's -- in some cases, this makes it impossible (or just annoying :) ) to compare RETester's results with perl's interpretation of a given regex.

Here's some differences, right from the gnu.regexp documentation, included with the plugin :
Unsupported Syntax Some flavors of regular expression utilities support additional escape sequences, and this is not meant to be an exhaustive list. In the future, gnu.regexp may support some or all of the following:

(?:...) pure grouping operator (Perl5)
(?=...) positive lookahead operator (Perl5)
(?!...) negative lookahead operator (Perl5)
(?#...) embedded comment (Perl5)
(?mods) inlined compilation/execution modifiers (Perl5)
\G end of previous match (Perl5)
\b word break positional anchor (Perl5)
\B non-word break positional anchor (Perl5)
\< start of word positional anchor (egrep)
\> end of word positional anchor (egrep)
[.symbol.] collating symbol in class expression (POSIX)
[=class=] equivalence class in class expression (POSIX)


Additionally, I've seen it act rather odd when using .* without an EOL anchor.

Replies are listed 'Best First'.
Re: JEdit's RE Tester. (boo)
by lachoy (Parson) on Apr 10, 2002 at 14:31 UTC

    Very true. However, I'd imagine the plugin will be modified in the future to use the JDK 1.4 built-in java.util.regex instead of the external gnu.regexp library. The built-in library includes (according to the 4th ed. of Java in a Nutshell):

    (?:...) (?=...) (?!...) (?<flags>:...) \G \b \B

    Since it's open-source, I'd imagine this would get done sooner rather than later :-)

    Chris
    M-x auto-bs-mode

      jEdit requires only JDK 1.3, so the likelihood of it switching from gnu.regexp to java.util.regex in the near term is very small. Even just switching the plugin is unlikely, since very few plugins are JDK 1.4 only (WheelMouse is the only one IIRC). However, I believe that for jEdit 4.0final (to be released within days) Slava Pestov has either upgraded to a new gnu.regexp that fixes the .* problems or he has patched jEdit's copy of gnu.regexp to fix them himself; regardless, I recall seeing a changelog entry recently noting that some .*-related bugs have been addressed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://157962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found