Merge pull request #1912 from ZYinMD/patch-1

correct minor error
This commit is contained in:
Ilya Kantor 2020-05-23 19:15:23 +03:00 committed by GitHub
commit 388903889c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ So, it matches the pattern `pattern:\bHello\b`, because:
2. Then matches the word `pattern:Hello`. 2. Then matches the word `pattern:Hello`.
3. Then the test `pattern:\b` matches again, as we're between `subject:o` and a space. 3. Then the test `pattern:\b` matches again, as we're between `subject:o` and a space.
The pattern `pattern:\bJava\b` would also match. But not `pattern:\bHell\b` (because there's no word boundary after `l`) and not `Java!\b` (because the exclamation sign is not a wordly character `pattern:\w`, so there's no word boundary after it). The pattern `pattern:\bHello\b` would also match. But not `pattern:\bHell\b` (because there's no word boundary after `l`) and not `Java!\b` (because the exclamation sign is not a wordly character `pattern:\w`, so there's no word boundary after it).
```js run ```js run
alert( "Hello, Java!".match(/\bHello\b/) ); // Hello alert( "Hello, Java!".match(/\bHello\b/) ); // Hello