I want to use QGIS expressions to split up a text string to an array with each element representing one character of the input's string, like:
input: mytext
-> ouput: [ 'm', 'y', 't', 'e', 'x', 't' ]
I tried regular expressions with regexp_matches()
function, but was not able to achieve it but partially:
regexp_matches( ('mytext'),'(.+)(.)(.+)') -> [ 'myte', 'x', 't' ]
I could, of course, use the same numer of capturing group (.)
as the input has characters. But the goal is an expression that works with any number of characters. How to achieve that?