Skip to content

Conversation

@niexia
Copy link
Contributor

@niexia niexia commented Oct 21, 2019

No description provided.


先行断言和后发断言都属于**非捕获簇**(不捕获文本 ,也不针对组合计进行计数)。
先行断言用于判断所匹配的格式是否在另一个确定的格式之前,匹配结果不包含该确定格式(仅作为约束)。
先行断言和后发断言(也叫 lookaround)都属于**非捕获组**(用于匹配模式,但不包括在匹配列表中)。当我们需要一个模式的前面或后面有另一个特定的模式时,就可以使用它们。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里改成(合称为 lookaround) 比较好,否则可能让人误会后发断言是lookaround

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实这样比较合理,我重新修改一下

<pre>
"/(.*at)/" => <a href="#learn-regex"><strong>The fat cat sat on the mat</strong></a>. </pre>
"/(.*at)/" => <a href="#learn-regex"><strong>The fat cat sat on the mat</strong></a>.
</pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要改?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

内容没修改,只是样例的格式调了一下,把 </pre> 换到下一行了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英文版的没有换行,这里肯定也不能换行啊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个,<pre> 标签是用来预格式化的文本,原版这个样例的确没换行。比较其他的,比较长的样例都会单独放换行的...,这个主要是原版的头 <pre> 是一行的,换了会对称一些... 这是为了直接看 markdown 文档的话不会有点怪,效果没差

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

@imba-tjd imba-tjd Oct 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

真要改也应该单独开一个PR把所有语言的都改了啊。反正我的意见是这种东西应该与原文一致。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也是,不在这个 PR 改这个吧

@ziishaned ziishaned merged commit 27c2e30 into ziishaned:master Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants