How to remove "everything" between brackets (abc123)?
let's say I have these files:
1- File name (720p).zip
2- File name (3000px2000).zip
3- File name [2 Vid] (5 Sets).zip
4- (Copy) File name [001].zip
How Can I remove any character or digit between brackets "() or []"?
Including the brackets.
So the final result be like = "File Name.zip" .
And it would be much appreciated if you could explain it in some details.
Thanks in advance.
1- File name (720p).zip
2- File name (3000px2000).zip
3- File name [2 Vid] (5 Sets).zip
4- (Copy) File name [001].zip
How Can I remove any character or digit between brackets "() or []"?
Including the brackets.
So the final result be like = "File Name.zip" .
And it would be much appreciated if you could explain it in some details.
Thanks in advance.
Use two Rename methods...
1) Replace: "(\(|\[)[^\)\]]*(\)|\]) ?"
2) Replace: " $"
Replace with nothing and check "Use regular expressions" in each case and do not include the quotation marks.
Read the basic introduction to regular expressions in the User Guide:
https://www.advancedrenamer.com/user_guide/regular_expresion s
For an explanation, first consider the removal only of strings within parentheses...
Replace: "\([^\)]*\) ?" with nothing
First note that characters such as "(" and "[" etc have special meanings in a regex and must be "escaped" by prefixing with "\" in order to represent themselves.
Explanation:
"\(" matches an opening parenthesis
"[^\)]*" matches any number of characters except those listed after "^" - ie match everything up to the next ")"
"\)" matches the closing parenthesis
Finally " ?" matches zero or one trailing spaces
This regex will leave an unwanted space at the end of filenames that end within a string within parentheses (ie the additional space that preceded the "("
To remove this use a second replace method with the regex: " $" - where "$" indicates that the space must be followed by the end of the string. (You could also combine the two steps into a single "List replace" method)
To remove strings within brackets we can simply replace "(" & ")" with "[" & "]"
ie Replace: "\([^\)]*\) ?"
However we can combine the two steps into a single regex using the OR metacharacter: "|"
so: "(\(|\[)" will match either "(" or "[" etc
Also add "\]" to the exclusion list ie "[^\)\]]*"
Hence: "(\(|\[)[^\)\]]*(\)|\]) ?"
1) Replace: "(\(|\[)[^\)\]]*(\)|\]) ?"
2) Replace: " $"
Replace with nothing and check "Use regular expressions" in each case and do not include the quotation marks.
Read the basic introduction to regular expressions in the User Guide:
https://www.advancedrenamer.com/user_guide/regular_expresion s
For an explanation, first consider the removal only of strings within parentheses...
Replace: "\([^\)]*\) ?" with nothing
First note that characters such as "(" and "[" etc have special meanings in a regex and must be "escaped" by prefixing with "\" in order to represent themselves.
Explanation:
"\(" matches an opening parenthesis
"[^\)]*" matches any number of characters except those listed after "^" - ie match everything up to the next ")"
"\)" matches the closing parenthesis
Finally " ?" matches zero or one trailing spaces
This regex will leave an unwanted space at the end of filenames that end within a string within parentheses (ie the additional space that preceded the "("
To remove this use a second replace method with the regex: " $" - where "$" indicates that the space must be followed by the end of the string. (You could also combine the two steps into a single "List replace" method)
To remove strings within brackets we can simply replace "(" & ")" with "[" & "]"
ie Replace: "\([^\)]*\) ?"
However we can combine the two steps into a single regex using the OR metacharacter: "|"
so: "(\(|\[)" will match either "(" or "[" etc
Also add "\]" to the exclusion list ie "[^\)\]]*"
Hence: "(\(|\[)[^\)\]]*(\)|\]) ?"
Reply to #2:
Wow! You just knocked me off my feet!
Thank you David, Again..
You are always so helpful ðŸ‘ðŸ‘
Wow! You just knocked me off my feet!
Thank you David, Again..
You are always so helpful ðŸ‘ðŸ‘