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

fix for StringScanner bug #4

Open
luikore opened this issue Mar 7, 2011 · 1 comment
Open

fix for StringScanner bug #4

luikore opened this issue Mar 7, 2011 · 1 comment

Comments

@luikore
Copy link
Owner

luikore commented Mar 7, 2011

require 'strscan'
ss = StringScanner.new "\n"
/./ =~ "\n" #=> 0
# but strscan's behavior is strange:
ss.scan /./ #=> nil

ss = StringScanner.new "a\n"
ss.scan /[.\n]/ #=> nil -- this group is interpreted as /\n/
@kzhamaji
Copy link

According to Ruby's manual, /./ doesn't match '\n' without using multi-line mode.

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

2 participants