Skip to content
Advertisement

REGEX_LIKE to ~*

Quick question, I found a replacement for Oracles REGEXP_LIKE, but I don’t see any documentation on multiple values. Can you tell me if the oracle and Postgres statements below are the equivalent?

WHERE REGEXP_LIKE(columnname, 'guarantee|standard', 'i')

WHERE columnname ~* 'guarantee|standard'

Advertisement

Answer

Yes, both expressions are equivalent.

From Postgres documentation:

~*: matches regular expression, case insensitive

From Oracle documentation:

REGEXP_LIKE performs regular expression matching

[…]

match param 'i' specifies case-insensitive matching, even if the determined collation of the condition is case-sensitive.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement