Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Matching Accents In Perl Regular Expresions, matching accents in perl regular expresi
mizako
post Sep 7 2005, 09:14 AM
Post #1


Super Member
*********

Group: Members
Posts: 372
Joined: 16-August 04
From: Spain
Member No.: 824



Does anyone knows how can i match accents in perl regular expresions.
I do not manage to match not english characaters such as á, é or ñ.
I hope there is someone taht knows the answer because i have been searching in google a long time without success.
Thanks in advanced
Go to the top of the page
 
+Quote Post
mathmate
post Mar 3 2007, 11:55 PM
Post #2


Newbie
*

Group: Members
Posts: 7
Joined: 3-March 07
Member No.: 39,519



QUOTE(mizako @ Sep 7 2005, 04:14 AM) *
Does anyone knows how can i match accents in perl regular expresions.
I do not manage to match not english characaters such as á, é or ñ.
I hope there is someone taht knows the answer because i have been searching in google a long time without success.
Thanks in advanced


According to the Perl tutorial, the current character set is ASCII, and characters within the set can be searched.
QUOTE
The term, language, when used in the sense borrowed from automata theory, can be a bit confusing. A language in automata theory is simply some (possibly infinite) set of strings. Each string (which can be possibly empty) is composed of a set of characters from a fixed, finite set. In our case, this set will be all the possible ASCII characters10.
and note 10 says
QUOTE

Perl will eventually support unicode, or some other extended character format, in which case it will no longer merely be ASCII characters.


For curiosity, I gave it a try, and the following code works with accented character à (alt-133).

CODE
$line ="ABCDE";
$line1="àbcdé";
if($line =~ m'a'i){printf("a is in %s\n",$line);}
if($line1 =~ m'à'i){printf("à is in %s\n",$line1);}


and the result is:

CODE
a is in ABCDE
à is in àbcdé

Tool completed successfully


Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Perl Help(1)
  2. First Perl Programm(5)
  3. Second Perl Programm(0)
  4. Perl Programms(0)
  5. Perl Programming(0)
  6. Using Mysql With Perl(1)
  7. Perl V.s. Php(5)
  8. Easy Authenication With Cgi/perl(0)
  9. Perl Progamming/scripting(3)
  10. Perl/cgi Help!(3)
  11. Perl Interview Questions(1)
  12. Compiling Perl / Python?(3)
  13. Xmlhttprequest And Perl(2)
  14. Call C Code From Perl(1)
  15. Few Perl Snippets For Misc Things(2)
  1. What Is Perl ? For A Layman Like Me !(7)
  2. Where Do I Install Perl Scripts?(6)
  3. Perl As A Way To Program Desktop Applications(8)
  4. Perl Interactive Mode(2)


 



- Lo-Fi Version Time is now: 26th July 2008 - 03:36 PM