Last active
December 21, 2015 07:43
-
-
Save koki-h/3c56243adcf640cca9e8 to your computer and use it in GitHub Desktop.
俺が分かる範囲ですべての全角/半角記号を除去(UTF8 とりあえずエラーにならない)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nkf' | |
| string = NKF::nkf( '-WwZ0', string ) #全角記号を半角に変換しておく | |
| string.gsub!(/[\s\!\"\#\$\%\&\'\(\)\-\=\^\~\\\|\@\`\[\]\{\}\;\:\+\*\<\>\,\.\/\?\_]/,"") #とりあえず全部エスケープしたがわけがわからん。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment