lib/regextest/front/parenthesis.rb in regextest-0.1.5 vs lib/regextest/front/parenthesis.rb in regextest-0.1.6
- old
+ new
@@ -48,11 +48,11 @@
attr_reader :prefix, :name, :refer_name, :offset, :length
# get name of parenthesis (if any)
def get_name(prefix)
- if(md = prefix.match(/^[<'](\w+)[>']$/))
+ if(md = prefix.match(/(?u:^[<'](\w+)[>']$)/))
md[1]
else
nil
end
end
@@ -63,10 +63,10 @@
if(md = prefix.match(/^\((\d+)\)$/))
condition_name = @options[:parens].get_paren(md[1].to_i)
if !condition_name
raise "condition number #{prefix} is invalid"
end
- elsif(md = prefix.match(/^\(<(\w+)>\)|\('(\w+)'\)$/))
+ elsif(md = prefix.match(/(?u:^\(<(\w+)>\)|\('(\w+)'\)$)/))
match_string = md[1] || md[2]
condition_name = @options[:parens].get_paren(match_string)
if !condition_name
raise "condition name (#{match_string}) is not found"
end