bugfindutils - Bugs: bug #58384, incorect documentaion for -regex


bug #58384: incorect documentaion for -regex

Submitter:  None
Submitted:  Sun 17 May 2020 06:44:02 PM UTC
Category:  documentation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.7.0
Fixed Release:  4.10.0
* Mandatory Fields

Add a New Comment Rich Markup

Sun 19 May 2024 12:41:22 PM UTC, comment #5: 

Fixed in git a couple of days ago.

James Youngman <jay>
Group administrator
Thu 09 Jun 2022 03:12:16 AM UTC, comment #4: 

In code, the default regextype is RE_SYNTAX_EMACS.
The syntax of these regular expressions seems to depend on gnulib.
Findutils just calls gnulib's regex match function...

Shuiqing Zhou <zhoushuiqing>
Fri 22 May 2020 11:03:23 AM UTC, comment #3: 

Indeed, the documentaion says the default regexps are compatible with
emacs regexp.  Even there is a link to emacs regexp node. But emacs
regexps understand the syntax `\{3,\}'.  That's the point I meant by
"incorrect documentaion".
So, I used
    $ find . -type f -regex-type posix-extended -regex '.{3,}'
instead.  This latter command works perfectly.

So, the emacs regexp style of find is not compatible with emacs regexp!
Sadly, that led me to waste time to investigate why my regexp did not

Karine CREVECOEUR <enikar>
Wed 20 May 2020 10:36:10 AM UTC, comment #2: 

Seems the documentation is wrong:

$ find . -type f -regex '.\{3,\}' | wc -l                      
$ find . -regextype posix-basic -type f -regex '.\{3,\}' | wc -l

Clearly the default is not posix-basic.

Geoff Clare <geoffclare>
Mon 18 May 2020 04:33:14 PM UTC, comment #1: 

Read on a litte bit:

There are several varieties of regular expressions; by default this
test uses POSIX basic regular expressions, but this can be changed
with the option @samp{-regextype}.

Andreas Metzler <ametzler>
Sun 17 May 2020 06:44:02 PM UTC, original submission:  


In find.texi line 488, it is sayed that regular expression used
in find are compatible with emacs regexp. Yet, I tried to
use `find -type f -regex '.\{3,\}'` to find files whose names
are longer that 2 characters. There are existing, anyway.
Find gave me no answer. I think the default regular expressions
in find are not the same as emacs regexp.

For completness, I use find from debian/sid package.

By the way, I thank you for yours excellent tools.

Gilles Crèvecœur



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by berny (Updated the item)
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by zhoushuiqing (Posted a comment)
  • -email is unavailable- added by geoffclare (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-27 berny Open/ClosedOpen Closed
        ReleaseNone 4.7.0
        Fixed Release4.7.0 4.10.0
    2024-05-19 jay StatusNone Fixed
        Assigned toNone jay

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code