Created
September 16, 2012 05:16
-
-
Save randym/3731106 to your computer and use it in GitHub Desktop.
control character regex matching in ruby 1.8.7 vs 1.9.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if RUBY_VERSION == "1.8.7" | |
nasty_control_char_matcher = Regexp.new("[\x01\x02\x03\x04\x05\x06\x07\x08\x1F\v\xE2]") | |
else | |
nasty_control_char_matcher = Regexp.new("[\x01\x02\x03\x04\x05\x06\x07\x08\x1F\v\u2028]") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment