Personal speech, I need some help
I'm trying to make a trigger in postgresql that checks if the format of a new data being inserted into a table is in a certain format, in this case the phone format.
I need the new phone to be inserted in the format +pp(dd)nnnnn-nnnn
My problem is in format verification, so it's currently NEW.telefone LIKE '^+([^0-9]{2}[^)][^0-9]{5}[^-][^0-9]{4}'
I'm new to regular expressions and I'm kind of lost, could you help me with this?