Declare @email varchar(max) = '+'
If @email LIKE '%[!#$%&''*+-/=?^_`{|}~]%'
PRINT @email
All special characters work fine except the +
and -
sign.
I tried to add \
before the plus sign in the If
statement, but it doesn't work.
Declare @email varchar(max) = '+'
If @email LIKE '%[!#$%&''*\+-/=?^_`{|}~]%'
PRINT @email
If I add \
before the plus sign in both the Declare
and If
statement, then it prints \+
Declare @email varchar(max) = '\+'
If @email LIKE '%[!#$%&''*\+-/=?^_`{|}~]%'
PRINT @email
How can I escape the +
or -
sign?