bugfix escape charactor for Regexp class #1038

Merged
merged 1 commit into from Mar 21, 2013

Conversation

Projects
None yet
1 participant
@ghost

ghost commented Mar 21, 2013

escape character type would have been limited current mruby.
(Ex: '\ t' isn't escaped.)

Code and execution environment are as follows:

  • environment(add regexp gem to build_config.rb)
 # Use Regexp class
 conf.gem :git => 'git@github.com:masamitsu-murase/mruby-hs-regexp.git'
  • sample code(literal.rb):
p (/a\nb/ =~ "a\nb")     # => 0
p (/a
b/ =~ "a\nb")            # => 0
p (%r!a\tb! =~ "a\tb")   # => 0
p (/a\\tb/ =~ "a\\tb")   # => 0
  • ruby
$ ruby -v
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-linux]
$ ruby literal.rb
0 # => OK
0 # => OK
0 # => OK
0 # => OK
  • before(current mruby/mruby)
$ ./bin/mruby literal.rb
0 # => OK
0 # => OK
0 # => OK
nil # => NG
  • after(pr-regexp-escape)
$ ./bin/mruby literal.rb
0 # => OK
0 # => OK
0 # => OK
0 # => OK

matz added a commit that referenced this pull request Mar 21, 2013

Merge pull request #1038 from kouki-o-iij/pr-regexp-escape
bugfix escape charactor for Regexp class

@matz matz merged commit f6646f4 into mruby:master Mar 21, 2013

1 check passed

default The Travis build passed
Details

@ghost ghost deleted the pr-regexp-escape branch Mar 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment