Skip to content

nix search throws incorrect error about empty regex for many inputs #3047

@lilyball

Description

@lilyball

When I run nix search with anything beyond the absolute most basic args, it tends to throw an error saying "An empty regex is not allowed in the POSIX grammar". This is extremely bizarre as my input is not empty.

Here are some failing examples:

  • nix search '\youtube'
  • nix search '(?:jazzy)'
  • nix search 'foo(?i)bar'

All of these are valid regular expressions and should be accepted.

The first example is rather curious because putting a \y anywhere else works, and the leading slash works if it's actually escaping a magic char (like \.foo), it's only when there's a leading slash followed by a non-magic character that it gives this bogus error.

  • system: "x86_64-darwin"
  • host os: Darwin 18.7.0, macOS 10.14.6
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.2.2
  • channels(eridius): "nixpkgs-19.09pre186574.88d9f776091"
  • nixpkgs: /Users/eridius/.nix-defexpr/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions