Is there a way to get a certain word in a text using Shortcuts?

So I was recently wondering if there was a way to get a word in a text in the shortcut app. I made a concept to visualize what I mean:

I have obviously made changes to this photo, if this were a thing, I would use it.

Is there anything like this in Shortcuts?


Solution 1:

If “word” is defined as “any sequence of non-whitespace characters“, the built-in Split Text (approximative translation – I’m on a non-english system) action will do that if you set it to split “on whitespace”. Note that this will collect stuff that, to human understanding, is not part of a word; for instance, “My (somewhat) flawed, short answer” will be split into the units “My”, “(somewhat)”, “flawed,”, “short” and “answer”.

Isolating grammatical words, OTOH, is not something Shortcuts supports out of the box, as it needs actual language analysis (don‘t try to solve that problem with a regular expression, lest you end up having two problems).