INTERACT FORUM

Please login or register.

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

Author Topic: Change to lowercase letter after apostrophe in first word (with Regex maybe?)  (Read 4034 times)

wnossel

  • Regular Member
  • Recent member
  • *
  • Posts: 13
  • nothing more to say...

My goal is to identify all songs with names containing an upper case letter following an apostrophe and to change this upper case letter into lower case.
For example "L'Enfance de l'Art" should become "L'enfance de l'art".
Using Clean File Properties to fix the capitalization to "upper case first word only" solves the problem for all instances except those in the first word. My example becomes "L'Enfance de l'art), properly fixing the second problem but missing the first one.

Now, a regular expression function like Regex([Name],/#^(.*)'([A-Z])(.*)#/,0,1) identifies the candidates for change.
However, I don't know how to tweak it in order to solve my problem. When referring to the second bracketed expression ([A-Z]), is there a way to make it lowercase? I tried using \l like in
=If(Regex([Name],/#^(.*)'([A-Z])(.*)#/,0,1),[R1]'\l[R2][R3],"")
but it does not work.

Any ideas or workarounds would be much appreciated. W.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

if(Regex([Name], /#^(.*')([A-Z])(.*)$#/,0,1), [R1]FixCase([R2],4)[R3], [Name])
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up