description |
---|
Tests whether the entire expression matches a pattern. |
- expression: The expression to compare.
- pattern: The pattern that is compared to the expression.
Examples
{% code title="SIMILAR_TO example" %}
SELECT 'shortcakes' SIMILAR TO '%cake_'
-- True
{% endcode %}
- expression: The expression to compare.
- pattern: The pattern that is compared to the expression.
- escape: Putting an escape_character before a wildcard in the pattern makes SIMILAR TO treat the wildcard as a regular character when it appears in the expression.
Examples
{% code title="SIMILAR_TO example" %}
SELECT '100%' SIMILAR TO '100!%' ESCAPE '!'
-- True
{% endcode %}
Succeeds only if the pattern matches the entire expression.