Ibrahim Mokdad
2009-May-25 11:33 UTC
Detecting Characters other the ASCII (Other than English)
Dear all I kinda need help on a project I''m working on; and I''m stuck on the part were I have to detect any Unicode character in the text file; will regular expressions "\w" work ? thnx in advance
Marnen Laibow-Koser
2009-May-25 16:27 UTC
Re: Detecting Characters other the ASCII (Other than English)
Ibrahim Mokdad wrote:> Dear all > I kinda need help on a project I''m working on; and I''m stuck on the > part were I have to detect any Unicode character in the text file; > will regular expressions "\w" work ? > thnx in advanceWhy not . (period) in a regular expression? That should do what you want. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
No /w will not work. And . (period) will not work either. here is asdjflaw日本erjocd some text the japanese within this text looks like this \346\227\245\346\234\254 in unicode. it would not be matched by /w (letter or number set) or . (any character). each of the \ddd sets in the unicode character would be matched by a . (period) I am sure someone has a solution for this, but it is not me. unicode geniuses HEEEEELLLLLP ください。 tim On May 25, 9:27 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> Ibrahim Mokdad wrote: > > Dear all > > I kinda need help on a project I''m working on; and I''m stuck on the > > part were I have to detect any Unicode character in the text file; > > will regular expressions "\w" work ? > > thnx in advance > > Why not . (period) in a regular expression? That should do what you > want. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.