PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 3, 2022

[FIXED] Why Regex statement inverting isn't working?

 November 03, 2022     google-sheets, lambda, re2, regex, split     No comments   

Issue

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

Solution

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



Answered By - player0
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing