ve ona göre geçerli olduğunu: satır: için
/\//.exec("\/");
değerlendirir
RegularExpressionLiteral ::
/RegularExpressionBody/RegularExpressionFlags
RegularExpressionBody ::
RegularExpressionFirstChar RegularExpressionChars
RegularExpressionChars ::
[empty]
RegularExpressionChars RegularExpressionChar
RegularExpressionFirstChar ::
RegularExpressionNonTerminator but not * or \ or/or [
RegularExpressionBackslashSequence
RegularExpressionClass
RegularExpressionChar ::
RegularExpressionNonTerminator but not \ or/or [
RegularExpressionBackslashSequence
RegularExpressionClass
RegularExpressionBackslashSequence ::
\ RegularExpressionNonTerminator
RegularExpressionNonTerminator ::
SourceCharacter but not LineTerminator
\/
kabul edilir bir RegularExpressionBackslashSequence
ve dolayısıyla RegularExpressionBody
'un bir parçası olup, sonuç olarak //
yorum işaretçisinin bir parçası olamaz.
Bu nedenle, bazı düzenli ifade motorları farklı sınırlayıcılar belirtmenize izin verir ... – BoltClock
Spesifikasyonun bunun bir yorum yapmaya başlamadığını nasıl belirlediğini merak ediyorum. – pimvdb
Muhtemelen "var q =" // ";' ile aynı şekilde geçerlidir. –