regexp problem with UTF8

R

Risto Vaarandi

hi,

I have a perl program that has worked for 2 years on redhat and solaris
nodes without problems. Recently I moved it to a redhat9 node (which has
utf8 as default system character set), and discovered that the following
regular expression inside the program does not work:

if ($line =~ /^\s*([^=\s]+)\s*=\s*(.*\S)/) {
$keyword = $1;
$value = $2;
}

When the regexp is written as /^\s*(\w+)\s*=\s*(.*\S)/, or as
/^\s*([^=]+)\s*=\s*(.*\S)/ , everything works fine. What could be the
problem here? (When I change the system charset from UTF8 to iso8859-1,
it works.)

br,
risto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top