Find all rows using some Unicode range (such as Cyrillic characters) with PostgreSQL?

后端 未结 2 1540
天命终不由人
天命终不由人 2021-01-02 10:47

How do I find all rows of a PostgreSQL table that contain characters in some Unicode range, such as Cyrillic characters?

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 11:30

    Figured it out! For Cyrillic:

    SELECT * FROM "items" WHERE (title SIMILAR TO '%[\u0410-\u044f]%')
    

    I got the range from http://symbolcodes.tlt.psu.edu/bylanguage/cyrillicchart.html. The characters have hex entities А to я, which are also my numbers above.

提交回复
热议问题