1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 10:22:23 +00:00

Update regex.md

This commit is contained in:
succyag 2023-07-17 08:12:51 +08:00 committed by GitHub
parent ece963d6ab
commit 996628943c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,7 +376,7 @@ JavaScript 语言的正则表达式只支持先行断言lookahead和先
```javascript
/(?<=\$)\d+/.exec('Benjamin Franklin is on the $100 bill') // ["100"]
/(?<!\$)\d+/.exec('its worth about €90') // ["90"]
/(?<!\$)\d+/.exec('its worth about €90') // ["90"]
```
上面的例子中,“后行断言”的括号之中的部分(`(?<=\$)`),也是不计入返回结果。