re = /[\x{0080}-\x{02AF}\x{0300}-\x{03FF}\x{0600}-\x{06FF}\x{0C00}-\x{0C7F}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{2000}-\x{209F}\x{20D0}-\x{214F}\x{2190}-\x{23FF}\x{2460}-\x{25FF}\x{2600}-\x{27EF}\x{2900}-\x{29FF}\x{2B00}-\x{2BFF}\x{2C60}-\x{2C7F}\x{2E00}-\x{2E7F}\x{3000}-\x{303F}\x{A490}-\x{A4CF}\x{E000}-\x{F8FF}\x{FE00}-\x{FE0F}\x{FE30}-\x{FE4F}]/
str = 'Тест ⚡'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html