523 B
523 B
Answers: no, yes.
-
In the script
subject:Javait doesn't match anything, becausepattern:[^script]means "any character except given ones". So the regexp looks for"Java"followed by one such symbol, but there's a string end, no symbols after it.alert( "Java".match(/Java[^script]/) ); // null -
Yes, because the regexp is case-insensitive, the
pattern:[^script]part matches the character"S".alert( "JavaScript".match(/Java[^script]/) ); // "JavaS"