Ruby regex for Unicode punctuation?

Is there a regular expression in Ruby that identifies Unicode punctuation (e.g. ", -)?

+4
source share
2 answers
+2
source

You can use this:

 /[[:punct:]]/ 

Read the Regexp class for more details . You can also check it out on Rubular permalink

+6
source

All Articles