Skip to content

Commit 88b2971

Browse files
committed
Revert "Enable PCRE UTF-8 validity string checks (#26731)"
This reverts commit 627173b.
1 parent e6f5098 commit 88b2971

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

base/regex.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
include("pcre.jl")
66

7-
const DEFAULT_COMPILER_OPTS = PCRE.UTF | PCRE.ALT_BSUX | PCRE.UCP
8-
const DEFAULT_MATCH_OPTS = zero(UInt32)
7+
const DEFAULT_COMPILER_OPTS = PCRE.UTF | PCRE.NO_UTF_CHECK | PCRE.ALT_BSUX
8+
const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK
99

1010
mutable struct Regex
1111
pattern::String

test/regex.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,6 @@ end
5858
# Proper unicode handling
5959
@test match(r"∀∀", "∀x∀∀∀").match == "∀∀"
6060

61-
@test_throws ErrorException match(r"a", "\xe2\x88") # 1 byte missing at end
62-
@test_throws ErrorException match(r"a", "\xe2\x08\x80") # byte 2 top bits not 0x80
63-
@test_throws ErrorException match(r"a", "\xf8\x89\x89\x80\x80") # 5-byte character is not allowed (RFC 3629)
64-
@test_throws ErrorException match(r"a", "\xf4\x9f\xbf\xbf") # code points greater than 0x10ffff are not defined
65-
@test_throws ErrorException match(r"a", "\Udfff") # code points 0xd800-0xdfff are not defined
66-
@test_throws ErrorException match(r"a", "\xc0\x80") # overlong 2-byte sequence
67-
@test_throws ErrorException match(r"a", "\xff") # illegal byte (0xfe or 0xff)
68-
69-
@test_throws ErrorException Regex("\xe2\x88") # 1 byte missing at end
70-
@test_throws ErrorException Regex("\xe2\x08\x80") # byte 2 top bits not 0x80
71-
@test_throws ErrorException Regex("\xf8\x89\x89\x80\x80") # 5-byte character is not allowed (RFC 3629)
72-
@test_throws ErrorException Regex("\xf4\x9f\xbf\xbf") # code points greater than 0x10ffff are not defined
73-
@test_throws ErrorException Regex("\Udfff") # code points 0xd800-0xdfff are not defined
74-
@test_throws ErrorException Regex("\xc0\x80") # overlong 2-byte sequence
75-
@test_throws ErrorException Regex("\xff") # illegal byte (0xfe or 0xff)
76-
7761
# 'a' flag to disable UCP
7862
@test match(r"\w+", "Düsseldorf").match == "Düsseldorf"
7963
@test match(r"\w+"a, "Düsseldorf").match == "D"

0 commit comments

Comments
 (0)