This questions is in regards to Oracle, pl/sql, and the regexp_like function.
I am trying to build a character set that will match on all typical special characters. My character set currently looks like:
pattern := '[-~`!@#$%^&*\(\)\\{}_+=|''";:,./?]+';
I would like to add the square brackets to this character set, however, whatever I try to add ']' is not working. Here is a simple example that illustrates the problem:
select
case when regexp_like('w]ord', '[\]]+') then 'true'
else 'false' end
from dual;
This returns false, meaning it did not match the ']' character. Curiously, I can get the '[' character to match because this returns true:
select
case when regexp_like('w[ord', '[\[]+') then 'true'
else 'false' end
from dual;