Skip to content

Syntax Error occurs in regex #7306

@ydah

Description

@ydah

Environment Information

$ jruby -v          
jruby 9.3.6.0 (2.6.8) 2022-06-27 7a2cbcd376 Java HotSpot(TM) 64-Bit Server VM 25.341-b10 on 1.8.0_341-b10 +jit [x86_64-darwin]

$ uname -a
Darwin 1-2-240.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

Expected Behavior

regex.rb

r = /[]/
p r

There are no errors with ruby 3.1.2

$ ruby regex.rb
/[§]/

Actual Behavior

$ jruby regex.rb
SyntaxError: regex.rb:1: ASCII-8BIT mixed within UTF-8 source
r = /[\§]/
    ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions