norman/babosa

`word_chars!` is stripping numbers

Closed this issue · 0 comments

According to the docs for word_chars! it is not supposed to strip numbers from the string, but it is doing so as of 11e0f33

image

# Remove any non-word characters. For this library's purposes, this means
# anything other than letters, numbers, spaces, underscores, dashes,
# newlines, and linefeeds.
#
# @return String
def word_chars!
# `^\p{letter}` = Any non-Unicode letter
# `&&` = add the following character class
# `[^ _\n\r]` = Anything other than space, underscore, newline or linefeed
gsub!(/[[^\p{letter}]&&[^ _\-\n\r]]/, "")
to_s
end