|
|
|
|
![]() ![]() |
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 |
|
|
|
Mar 3 2007, 11:55 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 7 Joined: 3-March 07 Member No.: 39,519 |
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 saysQUOTE 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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 10:34 AM |