regexp_matches() returns an array of all matches. The string representation of the array contains curly braces because of which you get them.
If you only need a list of matching elements, you can use array_to_string() to convert the result to a "simple" text data type:
array_to_string(regexp_matches(note, '[0-9a-z \r\n]+', 'i'), ';')
If you are only interested in the first match, you can select the first element of the array:
(regexp_matches(note, '[0-9a-z \r\n]+', 'i'))[1]
a_horse_with_no_name
source share