Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chinese Translation] Inconsistent at the section 4. Lookaround/零宽度断言(前后预查) #188

Open
JigaoLuo opened this issue Jan 6, 2020 · 0 comments

Comments

@JigaoLuo
Copy link
Contributor

JigaoLuo commented Jan 6, 2020

English:

Lookbehind and lookahead (also called lookaround) are specific types of
non-capturing groups (used to match the pattern but not included in matching
list). Lookarounds are used when we have the condition that this pattern is
preceded or followed by another certain pattern. For example, we want to get all
numbers that are preceded by $ character from the following input string
$4.44 and $10.88. We will use following regular expression (?<=\$)[0-9\.]*
which means: get all the numbers which contain . character and are preceded
by $ character.

Chinese translation:

先行断言和后发断言都属于非捕获簇(不捕获文本 ,也不针对组合计进行计数)。
先行断言用于判断所匹配的格式是否在另一个确定的格式之前,匹配结果不包含该确定格式(仅作为约束)。

例如,我们想要获得所有跟在 $ 符号后的数字,我们可以使用正后发断言 (?<=\$)[0-9\.]*
这个表达式匹配 $ 开头,之后跟着 0,1,2,3,4,5,6,7,8,9,. 这些字符可以出现大于等于 0 次。

The example input string $4.44 and $10.88 does not occur in the chinese translation.

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

No branches or pull requests

1 participant