Home > Software engineering >  Why Regex statement inverting isn't working?
Why Regex statement inverting isn't working?

Time:10-08

This regex marks all words that start with capital letters:

[A-ZÖÄÜ] [a-zäüöß]*\b

But how can I reverse this so that all words that start with lowercase letters are marked? This one is not working:

[^A-ZÖÄÜ] [a-zäüöß]*\b

enter image description here

Here are some sentences for testing:

Teurer Dänemark-Urlaub hohe Stromkosten für Ferienhäuser
Top- Ökonom warnt  In der Schweiz bahnt sich ein globales Banken-Beben an!
Maisel kauft Weismainer Püls-Bräu

CodePudding user response:

The desired output is to delete all words that starts with lowercase

use:

=INDEX(TEXTJOIN(" ", 1, LAMBDA(x, 
 IF(REGEXMATCH(x&"", "^[a-zäüöß]"),,x))(SPLIT(A1, " "&CHAR(10)))))

enter image description here

  • Related