From: Eric Hodel Date: 2011-01-14T03:56:09+09:00 Subject: Re: String.strip with UTF-8 On Jan 12, 2011, at 16:43, Erik E. wrote: > Cool, thanks for that! I can just gsub/gsub! it out now that I know what > it is. That will work if NO-BREAK SPACE is the only space you'll encounter. s.gsub(/\A[[:space:]]*(.*?)[[:space:]]*\z/) { $1 } will remove: Space_Separator | Line_Separator | Paragraph_Separator | 0009 | 000A | 000B | 000C | 000D | 0085 See section 6 of http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt PS: Note that s.gsub(/…(…)…/, '\1') may alter the encoding of the result string.