Hello, I have a code to put a capital letter at the beginning of a sentence after '- it works well but I met a problem for the form of the following title:
Title: This is halloween (orchestra - only version)
After the convertion: This is halloween (orchestra) - only version
It should rather be: This is halloween (orchestra - Only Version)
Code I have:
Regular expression:
CODE
(?
?<=\s-\s)|^)(.*?)(?=$|\s-\s)
Replace matches with: $caps3($1)
With this code:
Field: TITLE
Regular expression:
(?:(?<=\s-\s)|^)(.*?)(?=$|\s-\s)
Replace matches with:
Sentence Case
$caps3($1)
Result: Dire straits - Sultans of swing
he should put my titles capitalized beginning of a sentence but after ' - '. It makes me well except in one case:
Title: This is halloween (orchestra - only version)
Result: This is halloween (orchestra) - only version
It shoulds rather be: This is halloween (orchestra - Only Version)
You may try something like this ...
Action "Format value"
Field: TITLE
Formatstring: $regexp(%TITLE%,'\b.','\u$0')
From:
TITLE = 'This is Halloween (Orchestra - only version)'
To:
TITLE = 'This Is Halloween (Orchestra - Only Version)'
Action "Format value"
Field: TITLE
Formatstring: $regexp($regexp(%TITLE%,'\b.','\u$0'),'(?<!^)\b(is|on|to|from|of|this)\b','\l$1',1)
From:
TITLE = 'This is Halloween (Orchestra - only version)'
To:
TITLE = 'This is Halloween (Orchestra - Only Version)'
DD.20150401.2020.CEST
No, it is a code given to me here /t/16302/1
by Victor Kostas
Post November 9, 2014, 12:21
I give you but it is good but in the case seen above it is not anymore.
Field: TITLE
Regular expression:
(?:(?<=\s-\s)|^)(.*?)(?=$|\s-\s)
Sentence Case
$caps3($1)
Result: Dire straits - Sultans of swing
I would like to start a capital sentence, but not at the beginning of each word. And capital at the beginning of ' - '
Great thank you. I have no more problem.