Update article.md

\b instead of \  in word boundary 2 example
This commit is contained in:
YNataly 2017-10-18 20:57:37 +03:00 committed by GitHub
parent ccc0e9327f
commit 4a9a6abf7c

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.