mysql5.7中文匹配度 match,mysql_正则匹配中文(Mysql_ regular matches Chinese).doc

mysql_正则匹配中文(Mysql_ regular matches Chinese)

mysql_正则匹配中文(Mysql_ regular matches Chinese)

MySQL regular matching Chinese

With MySQL in HEX, the field is converted to 2, and then the regular matches the corresponding Chinese code code.

Our field stores utf8, so we query the utf8 Chinese character encoding table (if you are GBK, check the corresponding code control)

Chinese characters e[4-9][0-9a-f]{4}

Number (3[0-9])

The letter (4[0-9A-F]|5[0-9A]|6[0-9A-F]|7[0-9A]) corresponds to the code

Regular can be written as:

HEX (name) REGEXP'[[: <:>:]]'

Not \<: tetralogy of fallot:>: "MySQL is a regular stop / start.

REG_EXP_DATE = ^ (

([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3}) -

(

((0[13578]|1[02]) - (0[1-9]|[12][0-9]|3[01])) | ((0[469]|11) - (0[1-9]|[12][0-9]|30) | (02-) (0[1-9]|[1][0-9]|2[0-8]))

| (()) ([0-9]{2}) (0[48]|[2468][048]|[13579][26]) | ((0[48]|[2468][048]|[3579][26]) 00)) -02-29) \\s+ ([0-1])? [0-9]|2[0-3]) - ([0-5][0-9]) - ([0-5][0-9]) ";

Corresponding database YYYY-MM-DD HH24-MI-SS

(0[13578]|1[02]) | (0[469]|11) |02

Special characters in regular expressions

Characters /

Significance: for characters, they usually indicate literal meaning and indicate that the next character is a special character, without explanation.

For example, /b/ matches the character 'B' by adding a backslash in front of B, that is, /b/, which turns into a special character

A line that matches a word.

Or:

For several characters, the instructions are special, pointing out that the characters that follow are not special, but should be interpreted literally.

For example: * is a special character that matches any character (including 0 characters); for example, /a*/ means matching 0 or more a. To match the literal *, add a backslash to the front of the A; for example, /a*/ matches' a*'.

Characters ^

Significance: the characters that represent the match must be in the front.

For example: /^A/ mismatch \ \ an, A, \ \ in 'A', but match

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值