4

I am trying to use ReNamer regular expressions to reverse folder names that use author names. They are set up as LastName, FirstName and I need to change them to FirstName LastName (minus the comma).

In ReNamer regular expressions usage is set up as Expression on one line and Replace on the second. I assume in this case Input then Output. I've tried several solutions from here but could not get anything to work at all. I barely understand the extreme basics of regex so any and all help is much appreciated.

According to file and folder renaming program, ReNamer, regex is the only option of several choices that will do what I need. I tried someones suggestion from another site. In the Expression Line I typed ([^,]*), (.) then in the Replace Line I typed \2 \1. The result changed Duncan, Dave to 2 1.

6

I don't know ReNamer but following regex logic this should work:

From: "^([^,]*), (.*)"
To  : "\2 \1"

Explanation:

  • initial ^ means 'start of the expression'
  • the () brackets indicate part of the expression that are to be remembered and can be used in the replacement as \1 and \2.
  • [^,]* matches all characters up to but not including a comma (the ^ in this context means 'not-matching')
  • .* matches all remaining characters
  • the first bracketed expression is your LastName and the second bracketed expression is your FirstName
  • maybe you could mark the question as answered? – gogoud Mar 14 '15 at 20:38
  • I can't find how to mark the question answered. I ended up finding a better program, Advanced Renamer. So consider this question answered. – Roger Parker Mar 16 '15 at 19:57
  • @RogerParker You must click on the checkmark to the left of this answer so that it turns green. – Kevin Panko Mar 17 '15 at 14:36
  • 1
    @RogerParker You should rather answer the question yourself and explain how you used it to accomplish what you want. – slhck Mar 17 '15 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.