0

Uninstalled an application, but it continues to pop up whenever I try to interact with file types that it used to be associated with.

As usual, find has been invaluable in finding and eliminating leftovers. But I noticed that I couldn't seem to get the regex OR operator to work the way I expected it to.

Some things I tried that didn't work:

find / -iregex '(.*crossover.*)|(.*codeweavers.*)'          2>/dev/null
find / -iregex '(^.*crossover.*$)|(^.*codeweavers.*$)'      2>/dev/null
find / -iregex '\(.*crossover.*\)\|\(.*codeweavers.*\)'     2>/dev/null
find / -iregex '\(^.*crossover.*$\)\|\(^.*codeweavers.*$\)' 2>/dev/null

Some things I tried that did work:

find / -iregex '\(.*crossover.*\)' 2>/dev/null
find / -iregex '^.*crossover.*$'   2>/dev/null
find / -iregex '.*crossover.*'     2>/dev/null

I was under the impression that if '\(.*crossover.*\)', returns a match..
Then '\(.*crossover.*\)\|whatever' should too.

What's the correct syntax?

  • Works for me. Linux Mint in VirtualBox. – Toto Oct 12 '18 at 17:13
  • In my Debian 9 the first two don't work. The rest does. – Kamil Maciorowski Oct 16 '18 at 7:06
0

As long as you escape pipe it (as your first two examples do wrong) the rest should work.

Tested:

I have the files /home/gaston/.viminfo and /home/gaston/.vim

find ~ -iregex '.*/\.vim\|.*/\.viminfo' yields

/home/gaston/.viminfo
/home/gaston/.vim

and find ~ -iregex '.*/\.vim\|s;dlfkgj;slfjgs' yields:

/home/gaston/.vim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.