mardi 10 décembre 2019

Uppercase every first English letter if it isn't uppercased already, with regex

I have a plain text document I process with Visual Studio Code, with about 1000 lines.
Each line contains a sentence that starts with an English letter.

  • No special characters are used as a starting character.
  • In some sentences, the first letter is uppercased,
  • In some other sentences, the first letter is lowercased.

I desire to uppercase every first English letter if it isn't uppercased already, with regex

What I have tried:

Search (match):

^[a-z]*

Replace with:

[A-Z]*

Result:

A-Z*U+0020 sentence

A-Z* sentence

To clarify, I got:

A-Z* + U+0020 (a whitespace character), in all lines.

My question

How could I uppercase every first English letter that isn't uppercased already, with regex?

Aucun commentaire:

Enregistrer un commentaire