# 现代汉语词典第七版【书面语】收录词条

**URL:** <https://forum.freemdict.com/t/topic/22509>\
**Category:** 资源分享\
**Tags:** txt, 技术\
**Created:** [2023 年8 月 2 日 07:48 UTC](https://forum.freemdict.com/t/topic/22509 "2023-08-02T07:48:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Howie](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/9fc29f/32.png) [@Howie](https://forum.freemdict.com/u/Howie)\
**Post date:** [2023 年8 月 2 日 07:48 UTC](https://forum.freemdict.com/t/topic/22509/1 "2023-08-02T07:48:43Z")

</div>

[现代汉语词典+古汉语常用字字典](https://forum.freemdict.com/t/topic/9621)

选取一部分内容：

```xml
愤懑
<link rel="stylesheet" type="text/css" href="hycd.css"><entry><hw>愤懑</hw><py>fènmèn</py><def><pt>书</pt><ps>形</ps>气愤；抑郁不平：～之情，溢于言表。</def></entry>
</>
羞花闭月
<link rel="stylesheet" type="text/css" href="hycd.css"><entry><hw>羞花闭月</hw><py>xiūhuā-bìyuè</py><def>见〖<a href="entry://闭月羞花">闭月羞花</a>〗。</def></entry>
</>
羞赧
<link rel="stylesheet" type="text/css" href="hycd.css"><entry><hw>羞赧</hw><py>xiūnǎn</py><def><pt>书</pt><ps>形</ps>因害臊而红了脸的样子。</def></entry>
</>
羞辱
<link rel="stylesheet" type="text/css" href="hycd.css"><entry><hw>羞辱</hw><py>xiūrǔ</py><def><num>①</num><ps>名</ps>耻辱。</def><def><num>②</num><ps>动</ps>使受耻辱：～了他一顿。</def></entry>
</>
麟
<link rel="stylesheet" type="text/css" href="hycd.css"><entry><hw>麟（<sup>⁎</sup>麐）</hw><py>lín</py><def><pt>书</pt>麒麟：凤毛～角。</def><ci><div class="title">词语</div><div class="cont"><a href="entry://麟凤龟龙">麟凤龟龙</a></div></ci></entry>
</>

```

为了正确提取目标单词，我们需要在每个标记内再次使用正则表达式来提取包含书的内容。

找“书”，提取单词，结果为：

```auto
愤懑
羞赧
麟（麐）

```

这只是一个小小的demo，我想知道怎么把txt文本文件内容填充到excel第一列为单词，第二列为解释，我感觉好像更复杂一些……

[现汉7书面语.txt](https://forum.freemdict.com/uploads/short-url/fmF3pvo4K3ebmiV4PkeeIz3llyA.txt) (45.6 KB)

---

<div class="post-metadata">

**Author:** ![Howie](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/9fc29f/32.png) [@Howie](https://forum.freemdict.com/u/Howie)\
**Post date:** [2023 年8 月 2 日 07:52 UTC](https://forum.freemdict.com/t/topic/22509/2 "2023-08-02T07:52:24Z")

</div>

`<entry>(.*?)</entry>`: 正则表达式，用于匹配`<entry>`标记内的内容

`<pt>书</pt>`: 仅处理包含`<pt>书</pt>`的条目

`<hw>(.*?)</hw>`: 正则表达式，用于提取目标单词

去掉烦人的sup标签: java代码：`word.replaceAll("<sup>.*?</sup>", "");`
