56,687
社区成员
发帖
与我相关
我的任务
分享
mysql> SELECT '@#4905#6#10034#A#3#10040#A#4#10033#A#3#1#2#0#2#1000#' REGEXP
'^@#[0-9]{4}#[0-9]{1}#([0-9]{5}#[AB]#[0-9]{1}#){1,5}[0-9]{1}#[1|2]#[0|1]#[0|1|2]#[0-
9]{5}#$' AS test
-> ;
+------+
| test |
+------+
| 0 |
+------+
1 row in set (0.00 sec)
mysql> SELECT '1438#10031#0#4#10032#5#0#10034#1#0#' REGEXP'^[0-9]{4}#([0-9]{5}#(
[0-9]{3}|-[0-9]{3})#([0-9]{3}|-[0-9]{3})#){1,5}$'
-> ;
+-------------------------------------------------------------------------------
--------------------------------------+
| '1438#10031#0#4#10032#5#0#10034#1#0#' REGEXP'^[0-9]{4}#([0-9]{5}#([0-9]{3}|-[0
-9]{3})#([0-9]{3}|-[0-9]{3})#){1,5}$' |
+-------------------------------------------------------------------------------
--------------------------------------+
|
0 |
+-------------------------------------------------------------------------------
--------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT '@#4905#6#10034#A#3#10040#A#4#10033#A#3#1#2#0#2#1000#' REGEXP '^@
#[0-9]{4}#[0-9]{1}#([0-9]{5}#[AB]#[0-9]{1}#){1,5}[0-9]{1}#[1|2]#[0|1]#[0|1|2]#[0
-9]{4,5}#$' AS test;
+------+
| test |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql> SELECT '@#4905#6#10034#A#3#10040#A#4#10033#A#3#1#2#0#2#10000#' REGEXP '^@
#[0-9]{4}#[0-9]{1}#([0-9]{5}#[AB]#[0-9]{1}#){1,5}[0-9]{1}#[1|2]#[0|1]#[0|1|2]#[0
-9]{5}#$' AS test;
+------+
| test |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql>