正则表达式 mysql 转义_如何在Mysql中正则表达式中转义特殊的SQL字符

只需在角色前使用反斜杠,如

MySQL documentation section 9.1所示:

\0 An ASCII NUL (0x00) character.

\' A single quote ("'") character.

\" A double quote (""") character.

\b A backspace character.

\n A newline (linefeed) character.

\r A carriage return character.

\t A tab character.

\Z ASCII 26 (Control+Z). See note following the table.

\\ A backslash ("\") character.

\% A "%" character. See note following the table.

\_ A "_" character. See note following the table.

注意(来自MySQL文档):

If you use “\%” or “\_” outside of pattern-matching contexts, they evaluate to the strings “\%” and “\_”, not to “%” and “_”.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值