RegEx and Lists
Posted: Sat Feb 10, 2024 11:34 pm
At the moment I'm using the RegEx field to find and move a given word to the beginning of file name, using this:
What I'd like to be able to do instead, if possible, is to maintain a list of Words would then be used here instead of an individual Word. For example, in my list I'd have Apple, Orange, Banana and the above RegEx would look for each of those words and, if found, move it to the beginning of the filename. As time goes on I could just add a new word to the list. This would save me the trouble of needing to execute this regex on each Word individually, as my list is growing quite lengthy.
- Code: Select all
(?i)(^|.+) Word( .+|$)
Word - \1\3
What I'd like to be able to do instead, if possible, is to maintain a list of Words would then be used here instead of an individual Word. For example, in my list I'd have Apple, Orange, Banana and the above RegEx would look for each of those words and, if found, move it to the beginning of the filename. As time goes on I could just add a new word to the list. This would save me the trouble of needing to execute this regex on each Word individually, as my list is growing quite lengthy.