Is there a way to enable Everything to trim non ASCii characters?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Is there a way to enable Everything to trim non ASCii characters?

Post by harryray2 »

Is there a way to enable Everything to trim non ASCii characters?
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is there a way to enable Everything to trim non ASCii characters?

Post by void »

Moved from Renaming is not working properly if the file name has non English characters.



To remove non-ASCII characters from filenames:
  • Perform a search to find non-ASCII characters, for example:
    regex:[^\x00-\x7f]
  • Select the desired files
  • Press F2.
  • Check Regular expressions.
  • Change the old format to: [^\x00-\x7f]
  • Change the new format to:
  • Check the new filenames in the bottom list and click OK.


Are you looking to remove non-ASCII characters from pasted text?
-If so, please try rename_paste_format:
  • Copy and paste the following into your Everything search box:
    /rename_paste_format=[regexreplace:$newtext:,"[^\x00-\x7f]",""]
  • Press ENTER in your Everything search box.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Is there a way to enable Everything to trim non ASCii characters?

Post by NotNull »

void wrote: Fri Jan 20, 2023 2:21 am
  • Uncheck Regular expressions.
  • Change the old format to:
    %1
  • Change the new format to:
    [regexreplace:%1,"[^\x00-\x7f]",""]
  • Check the new filenames in the bottom list and click OK.
You likely have a very good reason why you chose this approach instead of the following. Why? (can't figure it out ...)
  • Check Regular expressions.
  • Change the old format to:
    [^ -~]
  • Change the new format to:
    (empty)
  • Check the new filenames in the bottom list and click OK.
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is there a way to enable Everything to trim non ASCii characters?

Post by void »

You likely have a very good reason why you chose this approach instead of the following. Why?
I like to leave regular expressions unchecked. (personal preference)

Your old and new formats are much easier to work with and remember.

I updated my original post form:
To remove non-ASCII characters from filenames:
  • Perform a search to find non-ASCII characters, for example:
    regex:[^\x00-\x7f]
  • Select the desired files
  • Press F2.
  • Uncheck Regular expressions.
  • Change the old format to:
    %1
  • Change the new format to:
    [regexreplace:%1,"[^\x00-\x7f]",""]
  • Check the new filenames in the bottom list and click OK.
to:
  • Perform a search to find non-ASCII characters, for example:
    regex:[^\x00-\x7f]
  • Select the desired files
  • Press F2.
  • Check Regular expressions.
  • Change the old format to: [^\x00-\x7f]
  • Change the new format to:
  • Check the new filenames in the bottom list and click OK.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Is there a way to enable Everything to trim non ASCii characters?

Post by NotNull »

void wrote: Mon Jan 23, 2023 5:12 am I like to leave regular expressions unchecked. (personal preference)
I can relate to that. The times I could not find some text in Notepad++, only to discover that regex mode was still enabled ...

Thanks for explaining!
Post Reply