mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
commit
afa1b0dbee
@ -376,7 +376,7 @@ JavaScript 语言的正则表达式,只支持先行断言(lookahead)和先
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
/(?<=\$)\d+/.exec('Benjamin Franklin is on the $100 bill') // ["100"]
|
/(?<=\$)\d+/.exec('Benjamin Franklin is on the $100 bill') // ["100"]
|
||||||
/(?<!\$)\d+/.exec('it’s is worth about €90') // ["90"]
|
/(?<!\$)\d+/.exec('it’s worth about €90') // ["90"]
|
||||||
```
|
```
|
||||||
|
|
||||||
上面的例子中,“后行断言”的括号之中的部分(`(?<=\$)`),也是不计入返回结果。
|
上面的例子中,“后行断言”的括号之中的部分(`(?<=\$)`),也是不计入返回结果。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user