Skip to content

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

@JigaoLuo

Description

@JigaoLuo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions