diff --git a/lib/regexp_parser/scanner/scanner.rl b/lib/regexp_parser/scanner/scanner.rl index 42ae78c..1db68f7 100644 --- a/lib/regexp_parser/scanner/scanner.rl +++ b/lib/regexp_parser/scanner/scanner.rl @@ -78,7 +78,7 @@ # try to treat every other group head as options group, like Ruby group_options = '?' . ( [^!#'():<=>~]+ . ':'? ) ?; - group_name_id_ab = ([^!0-9\->] | utf8_multibyte) . ([^>] | utf8_multibyte)*; + group_name_id_ab = ([^!=0-9\->] | utf8_multibyte) . ([^>] | utf8_multibyte)*; group_name_id_sq = ([^0-9\-'] | utf8_multibyte) . ([^'] | utf8_multibyte)*; group_number = '-'? . [0-9]+; group_level = [+\-] . [0-9]+; diff --git a/spec/scanner/groups_spec.rb b/spec/scanner/groups_spec.rb index 1ffdb5b..f146bd5 100644 --- a/spec/scanner/groups_spec.rb +++ b/spec/scanner/groups_spec.rb @@ -41,6 +41,7 @@ include_examples 'scan', '(? [:assertion, :nlookbehind, '(?', 0 => [:assertion, :nlookbehind, '(?)y', 0 => [:assertion, :nlookbehind, '(?)y', 0 => [:assertion, :lookbehind, '(?<=', 0, 4] # Options include_examples 'scan', '(?-mix:abc)', 0 => [:group, :options, '(?-mix:', 0, 7]