Add space before each capital letter

A swapping-ground for Regular Expression syntax

Add space before each capital letter

Postby johnmeyer » Sun Mar 22, 2009 1:30 am

I have many files that look like this:

NordineMerchantStipeLos Lobos - Opening Medley.mp3

I want to insert a space in front of each capital letter, although I don't want two spaces. Thus, this should be the result:

Nordine Merchant Stipe Los Lobos - Opening Medley.mp3

So, in the regular expression search, I do this:

([A-Z][a-z]*)

and in the replace, I do this:

\1

(note space in first position of the replace string).

This works fine for the first word ("Nordine" in the above example), but I can't get this function to repeat.

I don't care if I end up with double spaces, because those are trivial to remove with a second pass search/replace.

Thanks for any help, and as others have said, this utility is an amazing piece of work!
johnmeyer
 
Posts: 3
Joined: Tue Jan 27, 2009 2:04 am

Re: Add space before each capital letter

Postby GMA » Sun Mar 22, 2009 2:49 am

Hi, John:
Try using Add (7) > Word Space; I think that's what you need.

johnmeyer wrote:...this utility is an amazing piece of work!

Indeed :). Best regards,

Gabriel.
GMA
 
Posts: 91
Joined: Sun Dec 02, 2007 1:30 pm
Location: Argentina

Re: Add space before each capital letter

Postby specialt1212 » Sun Dec 30, 2012 3:56 pm

I appologize but I'm new to using this software can you elaborate how to do this.

I typed ([A-Z][a-z]*) in the RegEX (1) Match field

Then I typed Add (7) > Word Space in the RegEX (1) Replace field

but it wasn't giving the desired results. What am I doing wrong.
specialt1212
 
Posts: 1
Joined: Sun Dec 30, 2012 3:53 pm

Re: Add space before each capital letter

Postby Stefan » Sun Jan 20, 2013 1:52 pm

specialt1212 wrote:I appologize but I'm new to using this software can you elaborate how to do this.

I typed ([A-Z][a-z]*) in the RegEX (1) Match field

Then I typed Add (7) > Word Space in the RegEX (1) Replace field

but it wasn't giving the desired results. What am I doing wrong.


Are you kidding? :D

Add (7) is an rule of his own.
Nothing to do with RegEX (1) at all.

Meaning:
let RegEX (1) alone.
Use Add (7) only.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Add space before each capital letter

Postby wommy » Sun Mar 31, 2013 12:54 am

No doubt you have it now. I don't think the answer was as helpful as it could have been to a Noob. I am only adding here for any others that come along, here is the clarification. Go to Add(7) commands, then tick wordspace. That is all you need to do for the selected files.
wommy
 
Posts: 2
Joined: Sun Mar 31, 2013 12:47 am


Return to Regular Expressions