[英]PostgresSQL extract a word from sentence that has a special character in it
我的表中有一個句子字段與此類似
id text
100 the quick %brown fox %jumped over the %lazy dog
101 how are %you? Nice to %meet you
我只想提取附加了%的單詞,所以我的輸出是
%brown
%jumped
%lazy
%you
%meet
所以我嘗試使用regexp_split_to_array但失敗了。 我的桌子在Postgres中。
regexp到底對您不起作用? 例如:
t=# select regexp_matches('the quick %brown fox %jumped over the %lazy dog','%[a-z]{1,}','g');
regexp_matches
----------------
{%brown}
{%jumped}
{%lazy}
(3 rows)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.