How to remove the last part of file names using RegEx in lazy mode?
I have file names that end with the following pattern:
<string1> - <string2> - <string3> press
I wanted to remove the " - <string3> press" part at the end.
I tried to use the "Remove Pattern" rule, and specified the following string:
- *press
In normal mode, the file names are not affected at all.
In RegEx mode, AR ends up removing " - <string2> - <string3> press" because of greedy matching.
How do I force the RegEx engine to match in lazy mode?
I tried adding a ? to force lazy mode, like this:
- *?press
But it did not change the result.
Please help!
<string1> - <string2> - <string3> press
I wanted to remove the " - <string3> press" part at the end.
I tried to use the "Remove Pattern" rule, and specified the following string:
- *press
In normal mode, the file names are not affected at all.
In RegEx mode, AR ends up removing " - <string2> - <string3> press" because of greedy matching.
How do I force the RegEx engine to match in lazy mode?
I tried adding a ? to force lazy mode, like this:
- *?press
But it did not change the result.
Please help!
Reply to #1: Hi.
Try this .
Text to be replaced: ^(.+)-.+$
Replace with: $1
Occurrence : All
Use regular expressions
Aply to name
I hope that work
Try this .
Text to be replaced: ^(.+)-.+$
Replace with: $1
Occurrence : All
Use regular expressions
Aply to name
I hope that work
Reply to #2:
Thanks for the rapid solution!
It works.
That said, is there a formula to force lazy mode in RegEx?
It would be nice to know that method for future needs.
Thanks for the rapid solution!
It works.
That said, is there a formula to force lazy mode in RegEx?
It would be nice to know that method for future needs.