From: Rick DeNatale Date: 2009-05-09T22:30:19+09:00 Subject: Re: converting UTF-8 to entities like 剛 On Sat, May 9, 2009 at 8:40 AM, Jian Lin wrote: > Robert Dober wrote: >> On Sat, May 9, 2009 at 2:04 PM, Jian Lin wrote: >> sorry for a quite superficial answer, but can you use the unicode >> switch for regexen in your Ruby Version. This seems to be the problem. >> >> Robert > > > by the way... Robert... what is the regexen?  is it the regular > expression modifier?   I'd like it to match absolutely anything > (newline, 0, etc)... but seems like there is no match I'm pretty sure that Robert used regexen as the geeky way of pluralizing regex. The unicode switch (a u regular expression option) forces the use of unicode to interpret the string being matched, otherwise it uses whatever the encoding of the source file containing the regular expression. e.g. /./u If you want . to match newlines you want the m (multi-line) option. Normally . will match anything BUT a new line, m changes this. rb(main):001:0> "a\nb".match(/a.b/) => nil irb(main):002:0> "a\nb".match(/a.b/m) => # -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale