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

Already on GitHub? Sign in to your account

fix for StringScanner bug #4

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

Comments

Projects
None yet
2 participants
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/

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