re = /[^ -~]/m
str = ' Punctuation marks are standardized marks or signs used to clarify the meaning and separate structural units of text. The General Category property assigns characters to either Punctuation or Symbol based on their primary usage.
Q: Can you give a more complete list of Unicode punctuation characters that often should be treated as symbols?
A: Because this issue is about conflicting usage, it is not possible to generate a comprehensive list, however some of the most common ones are:
U+0023 ( # ) NUMBER SIGN
U+0026 ( & ) AMPERSAND
U+0040 ( @ ) COMMERCIAL AT
U+0025 ( % ) PERCENT SIGN
U+2030 ( ‰ ) PER MILLE SIGN
U+2031 ( ‱ ) PER TEN THOUSAND SIGN
U+002A ( * ) ASTERISK
U+2020 ( † ) DAGGER
U+2021 ( ‡ ) DOUBLE DAGGER
U+203B ( ※ ) REFERENCE MARK
Łąka
Русский
维基百科,自由的百科全书'
# 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