-
-
Save xaviershay/5dd56997b3e5a8b9eee6 to your computer and use it in GitHub Desktop.
This file contains 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
# encoding: UTF-8 | |
# String interpolation into regexes appears to break unicode property names. | |
# This script works under MRI 1.9.2 | |
# Breaks under jruby --1.9 | |
# The following two scenarios work | |
puts /[\p{L}]/u | |
puts /[#{"\\p{L}"}]/u | |
# this one raises an exception | |
# RegexpError: (RegexpError) invalid character property name {L}: /\p{L}/ | |
b = "\\p{L}" | |
puts /[#{b}]/u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment