By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT REGEXP_REPLACE("[mention]987[/mention]", "^\\[([^]]+)\\]([^[]+)\\[\\/\\1\\]", "\\2");
REGEXP_REPLACE("[mention]987[/mention]", "^\[([^]]+)\]([^[]+)\[\/\1\]", "\2") |
---|
987 |