mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
11 lines
271 B
JavaScript
11 lines
271 B
JavaScript
// Regex literal (direct and slash-forced-as-regex paths)
|
|
let a = /foo/;
|
|
let b = /bar/gi;
|
|
let c = 1 + /baz/i;
|
|
|
|
// Regex inside a function (exercises ownership transfer through FunctionPayload)
|
|
function matchDigits(s) {
|
|
return /\d+/g.test(s);
|
|
}
|
|
matchDigits("abc123");
|