Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Question On Unicode characters

by kprasanna_79 (Hermit)
on Oct 04, 2010 at 08:18 UTC ( [id://863284]=perlquestion: print w/replies, xml ) Need Help??

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://863284]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-25 01:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found