Skip to main content
Solved

Extract capital letters from a string

  • October 1, 2023
  • 5 replies
  • 94 views

Forum|alt.badge.img+2

I want to be able to extract capital letters from a string (name of a type of event) to create its ID CODE.
This way I can keep my ID CODE as a formula, not manually, and still control how it comes out through the capitalizing of letters in the name.

For example:

 NeuroGym = NG
 Business Meeting = BM
 Annual global Event = AE
 Monthly internal Event = ME
 Business Event = BE

Best answer by Alexey_Gusev

If you want to remove lowercase letters and spaces, that's easy.

REGEX_REPLACE({Name},"[a-z ]","")

I thought exactly the same way, but was too lazy and asked chatbot. Seems like chatbot offered better solution

REGEX_REPLACE({YourTextField}, "[^A-Z]", "")

5 replies

Forum|alt.badge.img+21
  • Inspiring
  • October 1, 2023

If you want to remove lowercase letters and spaces, that's easy.

REGEX_REPLACE({Name},"[a-z ]","")

Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • Answer
  • October 1, 2023

If you want to remove lowercase letters and spaces, that's easy.

REGEX_REPLACE({Name},"[a-z ]","")

I thought exactly the same way, but was too lazy and asked chatbot. Seems like chatbot offered better solution

REGEX_REPLACE({YourTextField}, "[^A-Z]", "")


Forum|alt.badge.img+21
  • Inspiring
  • October 1, 2023

I thought exactly the same way, but was too lazy and asked chatbot. Seems like chatbot offered better solution

REGEX_REPLACE({YourTextField}, "[^A-Z]", "")


That's certainly better

AIChatbot is very informative.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • October 1, 2023

Lol. I was lazy and figured someone else would type the answer.


Forum|alt.badge.img+2
  • Author
  • New Participant
  • October 2, 2023

I thought exactly the same way, but was too lazy and asked chatbot. Seems like chatbot offered better solution

REGEX_REPLACE({YourTextField}, "[^A-Z]", "")


Worked beautifully, thank you 😃