2

I've got a bunch of files name in the format "words_separated_by_underscores_without_uppercases" and I'd want to rename them to the format "Words Separated By Spaces With Uppercases". I'm currently trying to do it with an app named "ReNamer", that takes regex as an input for the before after renaming parameters.

Replacing underscores with spaces is easy but I've been unable to find a way to replace the character next to the underscore with its capitalized counterpart.

How could this be done? Assuming it's possible to.

Jesús Cruz
  • 192
  • 2
  • 18
  • Examples of valid match and replacement will be lovely. –  Mar 05 '16 at 16:39
  • Possible duplicate of [Regex capitalize first letter every word, also after a special character like a dash](http://stackoverflow.com/questions/6251463/regex-capitalize-first-letter-every-word-also-after-a-special-character-like-a) – Tim Mar 05 '16 at 16:39
  • @Tim I only saw there the expression to match the input, which I already had. Found nowhere the output expression. In any case, the other Tim gave me the exact solution I needed. – Jesús Cruz Mar 05 '16 at 16:47
  • In general, a regex replace operation by itself can only add fixed text or rearrange/remove letters from the original input but not modify them. Some regex engines do have extra capabilities, ReNamer's engine doesn't seem to be among them. – Tim Pietzcker Mar 05 '16 at 16:52
  • I knew that the match of a regexp could be saved to a variable so I thought maybe it was posible to transform it afterwards (don't really know much about the topic). I didn't, however, find anything that confirmed or denied the possibility so I ended up resigning and asking here. – Jesús Cruz Mar 05 '16 at 17:04

1 Answers1

2

It's probably best to first replace all underscores with a space, and then add a "Case" Rule with the option "Capitalize Every Word":

ReNamer Screenshot

Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561