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:  None
Privacy:  Public Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  None
Fixed Release:  4.7.0
* Mandatory Fields

Add a New Comment Rich Markup
   

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
work.

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                      
0
$ find . -regextype posix-basic -type f -regex '.\{3,\}' | wc -l
16

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:  

Hi,

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.
Cheers

Gilles Crèvecœur

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code