mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-08-04 18:46:40 -04:00
new ch translation for example at section 4. Lookaround
This commit is contained in:
parent
d1ae5ee5e4
commit
7cc072bb55
@ -351,8 +351,8 @@
|
||||
前置约束和后置约束都属于**非捕获簇**(用于匹配不在匹配列表中的格式).
|
||||
前置约束用于判断所匹配的格式是否在另一个确定的格式之后.
|
||||
|
||||
例如, 我们想要获得所有跟在 `$` 符号后的数字, 我们可以使用正向向后约束 `(?<=\$)[0-9\.]*`.
|
||||
这个表达式匹配 `$` 开头, 之后跟着 `0,1,2,3,4,5,6,7,8,9,.` 这些字符可以出现大于等于 0 次.
|
||||
例如, 我们想要从输入字符串中`$4.44 and $10.88`获得所有跟在 `$` 符号后的数字, 我们可以使用正向向后约束 `(?<=\$)[0-9\.]*`.
|
||||
这个表达式匹配 `$` 开头, 之后跟着字符 `0,1,2,3,4,5,6,7,8,9,.`, 这些字符可以出现大于等于 0 次.
|
||||
|
||||
前后关联约束如下:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user