kprasanna_79 has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I have a word something similar to "Haõt", How do i match this word using perl. Please advice.


-Prasanna.K

Replies are listed 'Best First'.
Re: Question On Unicode characters
by ikegami (Patriarch) on Oct 04, 2010 at 13:52 UTC

    /Haõt/
    /Ha\N{U+00F5}t/
    /Ha\N{LATIN SMALL LETTER O WITH TILDE}t/

    If you encode your source file using UTF-8, don't forget to let Perl know by using use utf8;

Re: Question On Unicode characters
by moritz (Cardinal) on Oct 04, 2010 at 15:07 UTC

    If your string is properly decoded, \w \p{Letter} properly match the non-ASCII word characters too.

    So one way to match that word is \w+; knowing nothing about what the regex should not match, it's hard to give more specific advice.

    See also: Encodings and Unicode in Perl.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: Question On Unicode characters
by Anonymous Monk on Oct 04, 2010 at 08:36 UTC
    How do i match this word using perl

    Exactly the same as you match any other word using perl

    perluniintro

      Instead of character, we can use chr(245).

      Arivu

        But why? Cause you love to type extra chars?