Re: regex failure

maxwell <[email protected]>
Newsgroups gmane.editors.jedit.user
Message-ID <[email protected]>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.