Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String#sub incompatibility with CRuby #2816

Closed
tsahara opened this issue Jun 1, 2015 · 0 comments
Closed

String#sub incompatibility with CRuby #2816

tsahara opened this issue Jun 1, 2015 · 0 comments

Comments

@tsahara
Copy link
Member

tsahara commented Jun 1, 2015

% cat e.rb
puts '\n'.sub("\\", "\\\\\\\\")

% ruby e.rb
\\n

% bin/mruby e.rb
\\\\n

Note: bin/mruby above is built without Regexp gems.

@matz matz closed this as completed in 5dd2b8e Jun 8, 2015
matz added a commit that referenced this issue Jun 8, 2015
gsub/sub supports back references in substitutes.  fixes #2816.
ghost pushed a commit to iij/mruby that referenced this issue Jul 3, 2015
This implementation is compatible with CRuby's String#gsub/sub
except \1 ... \9 and \+.  They are useless without Regexp library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant