【发布时间】:2018-06-02 11:53:03
【问题描述】:
mysql>show full columns from bpsw;
+--------+------------------+-----------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+--------+------------------+-----------+------+-----+---------+----------------+---------------------------------+---------+
| bpswid | int(10) unsigned | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | |
| badpsw | varchar(128) | utf8_bin | NO | UNI | NULL | | select,insert,update,references | |
+--------+------------------+-----------+------+-----+---------+----------------+---------------------------------+---------+
不要跟我说not null 和default null :)
mysql> SELECT USER(), CHARSET(USER()), COLLATION(USER());
+----------------+-----------------+-------------------+
| USER() | CHARSET(USER()) | COLLATION(USER()) |
+----------------+-----------------+-------------------+
| root@localhost | utf8 | utf8_general_ci |
+----------------+-----------------+-------------------+
1 row in set (0.00 sec)
表格内容:
mysql> select * from bpsw limit X offset XXX ;
+--------+------------------------+
| bpswid | badpsw |
+--------+------------------------+
| 495883 | by all manner of means |
| 495884 | by all means |
| 495885 | by all odds |
| 495886 | by an ace |
| 495887 | by an iota |
| 495888 | by and by |
| 495889 | by and large |
| 495890 | by any chance |
| 495891 | by any manner of means |
| 495892 | by any means |
+--------+------------------------+
...
| 94950 | яростных |
| 1599 | ярь-медянка |
| 1600 | ястреб-перепелятник |
| 1601 | ястреб-тетеревятник |
| 94999 | яфетический |
| 1603 | яхт-клуб |
| 1604 | яхт-клуба |
...
| 1938 | яванский желоб |
| 1939 | яванское море |
| 94690 | еще какое-то слово |
| 1940 | яде-бузен залив |
| 94751 | ядерного |
| 94755 | раз два-три |
需要:从表中选择或删除西里尔字母。
需要删除ONE Cyrillic word WITHOUT数字的行,不带特殊字符,不带标点字符。
移除条件:'^[а-я]+[а-я]$+'
select * from bpsw where badpsw regexp '^[a-z]+[a-z]$+';
英文单词没有问题,但是西里尔字母我不明白它是怎么写的。
我认为有必要指定一个排序规则?
UPD: mysql regex utf-8 characters ?
这里我需要看看字节表示中的西里尔符号的含义吗?
【问题讨论】:
-
从你想删除的单词中给出一个示例字符。
-
或者给出一个清晰的列表你想删除的例子。
-
@reds,, ru.wikipedia.org/wiki/… 全部小写 а б в г д е ж з и й к л м н о п р с т у ф ч ....
-
所有这些字符都将被删除?
-
@reds "删除 ONE Cyrillic word WITHOUT digit, without special chars, without chars of punctuation 的行。"我可以不进行字节比较吗?
标签: mysql regex utf-8 character-encoding cyrillic