diff --git a/dist/index.js b/dist/index.js index 47735f7..a41e78f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1807,8 +1807,9 @@ function stringifyRegExpWithFlags(regex, refs) { } if (flags.m) { if (source[i] === "^") { - pattern += `(^|(?<=[\r -]))`; + // Changed from lookbehind (?<=[\r\n]) to support older iOS Safari (before 16.4) + pattern += `(^|[\r +])`; continue; } else if (source[i] === "$") { pattern += `($|(?=[\r diff --git a/dist/index.mjs b/dist/index.mjs index 3700b11..07d9a52 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1708,8 +1708,9 @@ function stringifyRegExpWithFlags(regex, refs) { } if (flags.m) { if (source[i] === "^") { - pattern += `(^|(?<=[\r -]))`; + // Changed from lookbehind (?<=[\r\n]) to support older iOS Safari (before 16.4) + pattern += `(^|[\r +])`; continue; } else if (source[i] === "$") { pattern += `($|(?=[\r diff --git a/src/to-json-schema/zod3-to-json-schema/parsers/string.ts b/src/to-json-schema/zod3-to-json-schema/parsers/string.ts index a4b98dc..803257a 100644 --- a/src/to-json-schema/zod3-to-json-schema/parsers/string.ts +++ b/src/to-json-schema/zod3-to-json-schema/parsers/string.ts @@ -388,7 +388,8 @@ function stringifyRegExpWithFlags(regex: RegExp, refs: Refs): string { if (flags.m) { if (source[i] === '^') { - pattern += `(^|(?<=[\r\n]))`; + // Changed from lookbehind (?<=[\r\n]) to support older iOS Safari (before 16.4) + pattern += `(^|[\r\n])`; continue; } else if (source[i] === '$') { pattern += `($|(?=[\r\n]))`;