0
文字列にpostgresqlの文字(a-z)または記号(#、@、 - など)があるかどうかを確認するにはどうすればよいですか?私のコメントからアルファベットと記号の文字列照合
文字列にpostgresqlの文字(a-z)または記号(#、@、 - など)があるかどうかを確認するにはどうすればよいですか?私のコメントからアルファベットと記号の文字列照合
正規表現(正規表現)例:
select *
from mytable
where my_field ~ '[a-z]' -- any lowercase character
他の例:正規表現の
'[A-Z]' -- any uppercase
'[aeiou]' -- any vowel
'[#@-]' -- the symbols you listed -- put the hyphen last, otherwise it's range
'[A-Za-z#@-]' -- all letters and your symbols
Pgのドキュメントは素晴らしいです:
https://www.postgresql.org/docs/9.5/static/functions-matching.html
使用する正規表現。チルダ '〜'はこれの演算子です。 – Hambone