[ jEdit-users ] regex failure

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ jEdit-users ] regex failure

e-letter
Readers,

For many years, simple regex search for upper case characters was easy
with '[A-Z]'.

No more!!!

Had to download some xsearch plugin!

That didn't work either with '[upper]' or '[:upper:]' according to the manual.

Example:

AOEUAEU euau
EOUAEUEAOUEOAUOAEUAEOAOE AUAEOU..KJA aeua,,.uoaejkoaeu
AEOUAAAEUAUA,. UEAUAU uaa,aeoaeuau
AUAPUAUKAUA.PA aua,.ua,aa,u,.u

The manual page 'Appendix E. Regular Expressions' does not describe
how to search for upper case characters.  It used to.

The plugin manual is poor.

If it worked, don't fix it ;)

------------------------------------------------------------------------------
--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ jEdit-users ] regex failure

Darien Brown
Make sure "ignore case" is unchecked in the search dialog. Having that checked is like having the i option at the end of your regex.




On Mon, Nov 21, 2016 at 5:08 AM, e-letter <[hidden email]> wrote:
Readers,

For many years, simple regex search for upper case characters was easy
with '[A-Z]'.

No more!!!

Had to download some xsearch plugin!

That didn't work either with '[upper]' or '[:upper:]' according to the manual.

Example:

AOEUAEU euau
EOUAEUEAOUEOAUOAEUAEOAOE AUAEOU..KJA aeua,,.uoaejkoaeu
AEOUAAAEUAUA,. UEAUAU uaa,aeoaeuau
AUAPUAUKAUA.PA aua,.ua,aa,u,.u

The manual page 'Appendix E. Regular Expressions' does not describe
how to search for upper case characters.  It used to.

The plugin manual is poor.

If it worked, don't fix it ;)

------------------------------------------------------------------------------
--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ jEdit-users ] regex failure

e-letter
On 21/11/2016, Darien Brown <[hidden email]> wrote:
> Make sure "ignore case" is unchecked in the search dialog. Having that
> checked is like having the i option at the end of your regex.
>

Ignore case is not activated.

------------------------------------------------------------------------------
--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ jEdit-users ] regex failure

maxwell
In reply to this post by e-letter
On 2016-11-21 05:08, e-letter wrote:

> For many years, simple regex search for upper case characters was easy
> with '[A-Z]'.
>
> No more!!!
>
> Had to download some xsearch plugin!
>
> Example:
>
> AOEUAEU euau
> EOUAEUEAOUEOAUOAEUAEOAOE AUAEOU..KJA aeua,,.uoaejkoaeu
> AEOUAAAEUAUA,. UEAUAU uaa,aeoaeuau
> AUAPUAUKAUA.PA aua,.ua,aa,u,.u

This works fine for me, using jEdit v5.3.0.  That is, I enter the search
expression
     [A-Z]
making sure "Regular expressions" is turned on and "Ignore case" is
turned off.  Then I search the text you provide, and it stops at every
upper-case letter, and skips over every lower-case letter or non-letter.

> That didn't work either with '[upper]' or '[:upper:]' according to the
> manual.

Not sure what you're saying here, but this
    \p{Upper}
works fine with jEdit's built-in regex search, as documented in the
manual (specifically, as documented in
http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html,
which is the link in the first line of the jEdit regex search help).

I'm not a jEdit developer, but if you want help, I think you'll need to
explain a bit more clearly what you're trying, and in what way it isn't
working.  This--
> No more!!!
--doesn't tell anyone whether you're getting a Java bug, jEdit is
crashing, the regex doesn't find any characters (upper or lower), the
regex finds upper case characters but also lower case characters, or any
number of other things that might go wrong.  You also need to say what
version of jEdit you're using, and preferably what OS (although the
latter probably doesn't matter in this case).

> The manual page 'Appendix E. Regular Expressions' does not describe
> how to search for upper case characters.  It used to.
>
> The plugin manual is poor.

Not sure what the plugin manual has to do with this, but: You can use
either a range '[A-Z]' (like in any other regex language I've ever
seen), or you can use the above-mentioned \p{Upper}.  Both character
ranges and the \p codes are described in the section "Character Class
Operator" in jEdit's Help.  Of course the latter method should work with
characters from any Unicode block that has an upper/lower case
distinction, whereas [A-Z] will only work with ASCII characters.

    Mike Maxwell
    University of Maryland


------------------------------------------------------------------------------
--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ jEdit-users ] regex failure

Andrew Sowerby
In reply to this post by e-letter
Hi,

It works fine, as tested in jEdit 5.1.0. Actually, I've not noted any change in behaviour.

I suspect you're seeing this issue because you have "ignore case" checked.

Using your example, if you search for [A] with 'ignore case' checked it will match 'A' and 'a'. However, if you uncheck 'ignore case' the same search term will only match 'A'.
If then, with "ignore case" still unchecked, and a search term of [Aa], you'll find that this matches exactly the same way as [A], or [a], with "ignore case" checked.

This behaviour seems to be as expected, and I don't remember either REGEX standard that jEdit used ever overriding "ignore case" = "true". 
jEdit has been using java.util.regex.Pattern for so long now, that I can barely remember how gnu.regexp worked (jEdit switched away from that back in 4.2, which came out in 2004)!

I just tested again, using xsearch, which uses gnu.regexp and therefore works like jEdit used to prior to v4.2, and it works in exactly the same way in this respect. It's just horrible to use ;)




- Andrew

On 21 November 2016 at 10:08, e-letter <[hidden email]> wrote:
Readers,

For many years, simple regex search for upper case characters was easy
with '[A-Z]'.

No more!!!

Had to download some xsearch plugin!

That didn't work either with '[upper]' or '[:upper:]' according to the manual.

Example:

AOEUAEU euau
EOUAEUEAOUEOAUOAEUAEOAOE AUAEOU..KJA aeua,,.uoaejkoaeu
AEOUAAAEUAUA,. UEAUAU uaa,aeoaeuau
AUAPUAUKAUA.PA aua,.ua,aa,u,.u

The manual page 'Appendix E. Regular Expressions' does not describe
how to search for upper case characters.  It used to.

The plugin manual is poor.

If it worked, don't fix it ;)

------------------------------------------------------------------------------
--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Users' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-users
Loading...