Issue 112046 - Regular expression with braces [:alpha:]{2}+ doesn't work properly
Summary: Regular expression with braces [:alpha:]{2}+ doesn't work properly
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: DEV300m80
Hardware: Unknown All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2010-06-02 19:35 UTC by fyva
Modified: 2017-05-20 10:12 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description fyva 2010-06-02 19:35:13 UTC
Regular expression with braces [:alpha:]{2}+ doesn't work properly. This
expression should work the same way as [:alpha:][:alpha:]+ (right?). But it
doesn't. Often [:alpha:]{2}+ gives a word without the last symbol, [:alpha:]{3}+
gives a word without the 2 last symbols and so on. Tested with Ubuntu 10.04 +
OOO320m12, OOO320m18, DEV300m80.
Comment 1 eric.savary 2010-06-02 19:59:31 UTC
Reassigned to SBA
Comment 2 Joe Smith 2010-06-03 16:36:36 UTC
Nested quantifiers are something of a gray area in regular expressions. I'm not
sure there is any clear "right" or "wrong" in this case.

If you were trying to match "two or more alpha's", then you would normally use
something like your alternative pattern: [:alpha:][:alpha:]+
Or the equivalent: [:alpha:]{2,}  (Note the added comma).

When the {min,max} quantifier has no comma and no 'max' ("{2}"), it means
exactly "min" repetitions. When there is a "min" with a comma but no "max"
("{2,}"), it means "min or more" repetitions.

A search in Writer for "[:alpha:]{2,}" finds any span of two or more alpha
characters, as expected.
Comment 3 j.tronel 2012-12-14 00:25:29 UTC
May I disagree ? [:alpha:]{2}+ does exactly what it is meant to : one or more groups of two letters, i.e. 2, 4, 6... letters.
If a word contains an odd number of letters, last one will not be selected.
Comment 4 Edwin Sharp 2014-03-05 12:56:25 UTC
Please attach example.
Comment 5 Edwin Sharp 2014-03-19 06:42:06 UTC
No info from author.