How to find sequence of Alphabets of non-ASCII (other languages) in a given string in PostgreSQL? For example, ASCII alphabets can be matched using ‘[A-Za-z]’.
In SQL Server, @ch BETWEEN ‘A’ and ‘Z’ matches the characters like Γ, ΓΌ, Γ, etc.
How to find sequence of Alphabets of non-ASCII (other languages) in a given string in PostgreSQL? For example, ASCII alphabets can be matched using ‘[A-Za-z]’.
In SQL Server, @ch BETWEEN ‘A’ and ‘Z’ matches the characters like Γ, ΓΌ, Γ, etc.
2
Answers
In PostgreSQL Regular expressions and character classesΒ can be used to match non-ASCII alphabets in a given string. Try running the following query to extract rows from your table where one or more characters from the non-ASCII alphabet are present in the ‘your_column’. For your particular case, change the table and column names as necessary.
Hope it’s helpful π
That depends on the collation you are using. With most natural language collations, the comparison would work:
The easiest way to check if a string contains only alphabetic characters is a regular expression: