AutoRename app - how to regex help - autorepalce illegal char in filename for windows

Hi,

search for help, i want configure auto-renamig files, when filename have illegal characters for windows (NC30.0.8 (snap install)).

When users from MAC/Linux sync files to Win…

For example file " sample file : name $ &test.PDF" to “_sample_file_name_test.PDF”

Finded app in store, AutoRename. But my regex dont work.

Can help me?

my regex:

{
test:01
[:]:_
[<]:_
[>]:_
[*]:_
[/]:_
[@]:_
[!]:_
[#]:_
[$]:_
[%]:_
[^]:_
[&]:_
[*]:_
[(]:_
[)]:_
[-]:_
[=]:_
[ ]:_
__:_
___:_
}

Two syntax issues:

  • AutoRename requires escaping colons in patterns using \: instead of : (see docs)
  • [^] is not valid regex ; use [\^] to match a literal caret

With these fixes, the rule below will rename test_!@#$%^&*().md to 01_.md

# .rename.conf
# Applied to files containing "test": replace special characters with underscores
{
test:01
[\:]:_
[<]:_
[>]:_
[*]:_
[/]:_
[@]:_
[!]:_
[#]:_
[$]:_
[%]:_
[\^]:_
[&]:_
[*]:_
[(]:_
[)]:_
[-]:_
[=]:_
[ ]:_
_+:_
}

Keep in mind that in grouped rules (enclosed in {}), the first pattern determines whether the rule is applied. So this rule only affects files whose names contain “test”.

If you want to apply the rule to all files that contain special characters, you can write it like this instead:

# .rename.conf
# For files with special characters: replace with underscores
[\:<>*/@!#$%\^&*()\-= ]+:_

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.