# 求助一例正则表达式，即每行提取 2 至 5 个汉字的行

**URL:** <https://forum.freemdict.com/t/topic/13893>\
**Category:** 软件经验交流展望\
**Created:** [2022 年7 月 5 日 02:15 UTC](https://forum.freemdict.com/t/topic/13893 "2022-07-05T02:15:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

作者： ![hanhteegs](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hanhteegs/32/26414_2.png) [@hanhteegs](https://forum.freemdict.com/u/hanhteegs)\
发布日期： [2022 年7 月 5 日 02:15 UTC](https://forum.freemdict.com/t/topic/13893/1 "2022-07-05T02:15:15Z")

</div>

求助一例正则表达式，即每行提取 2 至 5 个汉字的行。凡是含有标点、字母、数字者皆不取。

如图所示：提取【八本】【把印时】【白录】等

 ![Snipaste_2022-07-05_10-08-55](https://forumcdn.freemdict.com/uploads/default/original/3X/8/1/81d37495eed91f97ef6d843a1d04fccb836cc77d.jpeg)

下面附件是小样

[样例.txt](https://forum.freemdict.com/uploads/short-url/aCncEjhPPuZ7yRdnfcQ1J2i1Xnr.txt) (6.7 KB)

---

<div class="post-metadata">

作者： ![mdict6](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mdict6](https://forum.freemdict.com/u/mdict6)\
发布日期： [2022 年7 月 5 日 02:21 UTC](https://forum.freemdict.com/t/topic/13893/2 "2022-07-05T02:21:59Z")

</div>

如果把它导入excel 然后建立一列辅助列，计算字符，然后筛选，就可以。应该是不需要技术储备的最简单方法了  
然后excel的晋级软件，微软出的power bi，我在i5 16g ram 500g固态 1t机械盘的笔记本上，处理过7千万行的表格。同样只需要excel知识即可，入门比较简单。且，免费。

---

<div class="post-metadata">

作者： ![zheshijie](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/z/73ab20/32.png) [@zheshijie](https://forum.freemdict.com/u/zheshijie)\
发布日期： [2022 年7 月 5 日 02:35 UTC](https://forum.freemdict.com/t/topic/13893/3 "2022-07-05T02:35:39Z")

</div>

Emeditor：

```auto
^[一-龥]{2,5}$

```

---

<div class="post-metadata">

作者： ![endnote](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/9de0a6/32.png) [@endnote](https://forum.freemdict.com/u/endnote)\
发布日期： [2022 年7 月 5 日 04:13 UTC](https://forum.freemdict.com/t/topic/13893/4 "2022-07-05T04:13:43Z")

</div>

> [@zheshijie](#):
>
> `[一-龥]`

我经常用[\u4E00-\u9FA5]，正则表达式里字符跟Unicode值是等价的
