Update solution.md

This commit is contained in:
Ilya Kantor 2019-10-10 23:58:29 +03:00 committed by GitHub
parent 9fe85ae862
commit 662f5193aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ Answers: **no, yes**.
```js run ```js run
alert( "Java".match(/Java[^script]/) ); // null alert( "Java".match(/Java[^script]/) ); // null
``` ```
- Yes, because the regexp is case-insensitive, the `pattern:[^script]` part matches the character `"S"`. - Yes, because the part `pattern:[^script]` part matches the character `"S"`. It's not one of `pattern:script`. As the regexp is case-sensitive (no `pattern:i` flag), it treats `"S"` as a different character from `"s"`.
```js run ```js run
alert( "JavaScript".match(/Java[^script]/) ); // "JavaS" alert( "JavaScript".match(/Java[^script]/) ); // "JavaS"