Jump to content

Uppercase in part of string using RegEx


remin
 Share

Recommended Posts

Have you looked at the _StringTitleCase function to see how it is done there. Instead of trying to do it all in one shot, it might take more work.

 

BrewManNH,

_StringTitleCase is in the beta version isn't it?

But even if I install the beta version, it will not resolve my problem because I search a regex for:

- title case 

- title case for words >1 character

- sentence case

And title case only for words starting with a alphabetic character, not for words starting with numbers.

A "solution" that seems to work is to replace the double quotes temporary:

       local $ClipB2 = StringReplace($ClipB, '"', 'x||x')
       local $Result = Execute('"' & StringRegExpReplace($ClipB2, "(^|\s|\n^)([a-zà-ýœß])", '$1" & StringUpper("$2") &  "') & '"')
       local $Result2 = StringReplace($Result, 'x||x', '"')
Edited by remin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...