Edited Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fivefive
Posts: 60
Joined: 07 May 2022, 14:16

Edited

Post by fivefive » 28 Sep 2022, 17:38

Edited
Last edited by fivefive on 12 Mar 2023, 10:47, edited 1 time in total.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to extract word with all UPPER CASE?  Topic is solved

Post by boiler » 28 Sep 2022, 17:43

fivefive wrote: Question: Any idea how I could extract the first word in the sentence with all Upper case please?
Yes:

Code: Select all

Clipboard := "Tony loves BLUE colour"
RegExMatch(Clipboard, "\b[A-Z]+\b", Colour)
MsgBox, % Colour

fivefive wrote: 2nd question: Is there any way to delete all symbols/characters and numbers from a string?
Yes. Just be very specific about what you want to keep. Nothing but letters and spaces? Not even keep punctuation?

fivefive
Posts: 60
Joined: 07 May 2022, 14:16

Re: How to extract word with all UPPER CASE?

Post by fivefive » 28 Sep 2022, 17:45

Edited
Last edited by fivefive on 12 Mar 2023, 10:47, edited 1 time in total.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to extract word with all UPPER CASE?

Post by boiler » 28 Sep 2022, 17:47

Code: Select all

Clipboard := "Here's some text and some 'special' characters and even a number or 2."
CleanStr := RegExReplace(Clipboard, "[^ a-zA-Z]")
MsgBox, % CleanStr

fivefive
Posts: 60
Joined: 07 May 2022, 14:16

Re: How to extract word with all UPPER CASE?

Post by fivefive » 29 Sep 2022, 01:20

Edited
Last edited by fivefive on 12 Mar 2023, 10:47, edited 1 time in total.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to extract word with all UPPER CASE?

Post by boiler » 29 Sep 2022, 02:00

Code: Select all

Clipboard := "HOW ARE YOU today?"
RegExReplace(Clipboard, "\b[A-Z]+\b",, Count)
MsgBox, % Count

fivefive
Posts: 60
Joined: 07 May 2022, 14:16

Re: How to extract word with all UPPER CASE?

Post by fivefive » 29 Sep 2022, 08:05

Edited

Post Reply

Return to “Ask for Help (v1)”