Crate
Query:
select regexp_matches(’#abc #def #ghi’, ‘(#[^\s]*)’, ‘g’) limit 100;
Result:
Array[1]
1:#abc
Expected result:
Array[3]
1: #abc
2: #def
3: #ghi
Postgresql
Query:
select regexp_matches(’#abc #def #ghi’, ‘(#[^\s]*)’, ‘g’) limit 100;
Result:
{#abc}
{#def}
{#ghi}
As you can see in the pgsql result the regular expression seems to be correct.
The global flag is not working for the crate result.
If you have a look at the regexp_replace function instead - the global flag seems to work:
Crate
Query:
select regexp_replace(’#abc #def #ghi’, ‘(#[^\s]*)’, ‘CRATE’, ‘g’) limit 100;
Result:
CRATE CRATE CRATE
Is this issue known? Is there any workaround for it?