broot icon indicating copy to clipboard operation
broot copied to clipboard

Regex escape sequences require one extra backslash

Open FedericoStra opened this issue 2 years ago • 0 comments

I don't know whether this is the intended behavior, but I find it strange and confusing: regex search patterns require a double backslash to enter metacharacters and character classes.

For instance:

  • r/\\( instead of r/\(,
  • r/\\d instead of r/\d,
  • r/\\W instead of r/\W,
  • etc..

It's as if a single backslash on its own gets discarded: for instance r/\\.\t\x\t\$ will find files with a .txt extension.

FedericoStra avatar Sep 01 '22 15:09 FedericoStra