INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Regex - reintroduce spaces  (Read 707 times)

Daydream

  • Citizen of the Universe
  • *****
  • Posts: 770
Regex - reintroduce spaces
« 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.
Logged

fridden

  • Recent member
  • *
  • Posts: 31
Re: Regex - reintroduce spaces
« Reply #1 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
Logged

Daydream

  • Citizen of the Universe
  • *****
  • Posts: 770
Re: Regex - reintroduce spaces
« Reply #2 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.
Logged
Pages: [1]   Go Up