Skip to content

find: -regextype settings are lost across parentheses #933

Closed

Description

@zhangpan2001

A -regextype posix-basic setting before parentheses is ignored by -regex inside them. Adding parentheses changes which files match.

From the repository root after building:

uu_find="$PWD/target/debug/find"
tmp=$(mktemp -d)
(
    cd "$tmp" || exit
    mkdir d
    touch d/f1
    LC_ALL=C /usr/bin/find d -regextype posix-basic \( -regex '.*/f[0-9]+' \) -print
    LC_ALL=C "$uu_find" d -regextype posix-basic \( -regex '.*/f[0-9]+' \) -print
)

GNU prints nothing; uutils prints d/f1. Both exit 0 with empty stderr. Removing the parentheses makes both implementations print nothing.

This also affects -iregex. A -regextype setting inside parentheses is lost for regex tests after them.

Tested with uutils findutils 0.11.0, main 82cfc21f0d45fc654588f0f4243e9c6e5f57fc97, on Debian forky/sid, Linux x86_64, against /usr/bin/find from GNU findutils 4.11.0.

Activity

  1. zhangpan2001 commented on Oct 29, 2026

    @zhangpan2001
    ContributorAuthor

    I have prepared a PR for this issue.

  2. added a commit that references this issue on Nov 2, 2026
    f61690d
  3. added a commit that references this issue on Nov 3, 2026
    2cb3ade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions