This commit is contained in:
YRFT 2020-02-29 12:09:02 +08:00
parent 405150f1f2
commit 0307fcb9a4

View file

@ -17,7 +17,7 @@ alert( str.match(regexp) ); // #121212,#AA00ef
The problem is that it finds the color in longer sequences:
```js run
alert( "#12345678".match( /#[a-f0-9]{6}/gi ) ) // #12345678
alert( "#12345678".match( /#[a-f0-9]{6}/gi ) ) // #123456
```
To fix that, we can add `pattern:\b` to the end: