diff options
-rw-r--r-- | sample/test.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_system.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sample/test.rb b/sample/test.rb index b1560d310..f3ac9c4a4 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1931,7 +1931,7 @@ end def valid_syntax?(code, fname) p fname code = code.dup.force_encoding("ascii-8bit") - code.sub!(/\A(\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { + code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } code.force_encoding("us-ascii") diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index 2143fcad7..be441c95f 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -5,7 +5,7 @@ require_relative 'envutil' class TestSystem < Test::Unit::TestCase def valid_syntax?(code, fname) code = code.dup.force_encoding("ascii-8bit") - code.sub!(/\A(\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { + code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } code.force_encoding("us-ascii") |