Merge pull request #260 from YNataly/patch-4

Update article.md
This commit is contained in:
Ilya Kantor 2017-11-01 10:52:19 +03:00 committed by GitHub
commit 0f0b5aa750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,9 +101,9 @@ So it matches `pattern:\bHello\b` and `pattern:\bJava\b`, but not `pattern:\bHel
```js run
alert( "Hello, Java!".match(/\bHello\b/) ); // Hello
alert( "Hello, Java!".match(/\Java\b/) ); // Java
alert( "Hello, Java!".match(/\Hell\b/) ); // null
alert( "Hello, Java!".match(/\Java!\b/) ); // null
alert( "Hello, Java!".match(/\bJava\b/) ); // Java
alert( "Hello, Java!".match(/\bHell\b/) ); // null
alert( "Hello, Java!".match(/\bJava!\b/) ); // null
```
Once again let's note that `pattern:\b` makes the searching engine to test for the boundary, so that `pattern:Java\b` finds `match:Java` only when followed by a word boundary, but it does not add a letter to the result.