[^\u0600-\u06FF|0-9|-|_|\s] >
I have another script that seems to work but I'm asking how I can keep the extension while changing what I want in the base name?
Code: Select all
$a = get(SelectedItemsNames, "<crlf>");
$a = regexmatches("$a", "-|_|\s|[\u0600-\u06FF|0-9]|(\.[^.]+$)", "");
$a = RegExReplace("$a", "( ) +(?![ .])| +(?=\.)", "$1");
rename "l", "$a", p, , 64;Get-ChildItem | Rename-Item -NewName {($_.BaseName -replace '([^\u0600-\u06FF|0-9|\s|-|_])','') + $_.Extension}
XYplorer Beta Club