[Solved] Any way to split a string?
I’m storing 4 number values in a string like “10,20,30,40” and am trying to find a way to retrieve any of the values at random. Protopie’s text functions are super limited, so I tried to use the regexextract function, like in the following examples, to retrieve the 3rd value (30):
regexextract("10,20,30,40", "^([^,]+,){2}([^,]+)")
regexextract("10,20,30,40", "^(?:\d+,){2}(\d+)")
Instead of one value, I get “10,20,30”. Why is this? Is there a better way to get what I’m after, without the existence of a “split” function or similar?
Thanks in advance for any insight.