2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00
discourse/lib/freedom_patches/match.rb

9 lines
175 B
Ruby
Raw Normal View History

class String
# new to Ruby 2.4, fastest way of matching a string to a regex
unless method_defined? :match?
def match?(regex)
!!(self =~ regex)
end
end
end