INTERACT FORUM

More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: Daydream on January 03, 2013, 02:30:49 am

Title: Regex - reintroduce spaces
Post by: Daydream on January 03, 2013, 02:30:49 am
Need some help when the resident experts in all things regex return from vacation :)

I have some filenames with the following pattern

0348 - JohnDoe - SomePlaceInTheWorld - alphanum3r1c

I want to space out SomePlaceInTheWorld to Some Place In The World; before every capital letter I want a space inserted, for however many capital letters that group has (preferably not in front of the first letter - S here - but that's not imperative, I can replace double spaces).

Thanks for any ideas.
Title: Re: Regex - reintroduce spaces
Post by: fridden on January 03, 2013, 06:41:09 am
Quote
0348 - JohnDoe - SomePlaceInTheWorld - alphanum3r1c

Perhaps the following expression can be of use:

=if(Regex([Name],/#(\d+ - \w+? - )(\w+?)( - .*)#/),[R1]fixspacing([R2])[R3],[Name])

/fridden
Title: Re: Regex - reintroduce spaces
Post by: Daydream on January 03, 2013, 11:01:40 am
<facepalm> There is a FixSpacing function, eh...! Probably been there for a couple of years too.

Thanks for the heads-up, I can probably fix stuff now even without regex.