Ask a Question related to PERL Miscellaneous, Design and Development.
-
Stefan Rupp #1
Perl regular expression does not work on 5.8.0
Good afternoon,
we have a perl regular expression which always worked for us on
Solaris(SPARC) HPUX(IA64) and Debian GNU/Linux(i386). But now I have to
install a software on a RedHat based GNU/Linux i386 box and the same
expression does not work any longer.
See the following script:
----------------------------------------------------------
#!/usr/bin/perl
print "Enter lines with 'key = value'\n";
while ( <STDIN> ) {
if ( /^\s*([^\s=]+)\s*=\s*([^\"]\S*|\".*\")\s*/ ) {
print "Match! key = '$1', value = '$2'\n";
}
else {
print "No match.\n";
}
}
----------------------------------------------------------
On Debian (Woody) with Perl 5.6.1 it works, it matches lines like
a = b
On HPUX(IA64) with Perl 5.8.0 it works as well. On RedHat 9 with Perl
5.8.0 however, it does not match at all.
What am I doing wrong?
Any help is appreciated!
Regards,
Stefan
--
Stefan Rupp Phone: +49 (0) 2408 9456-44
Inform GmbH Fax: +49 (0) 2408 9456-45
Pascalstr. 23, 52076 Aachen, Germany E-Mail: [email]stefan.rupp@inform-ac.com[/email]
Stefan Rupp Guest
-
Regular Expression
Hi, I am writing a script that parses an html file (which has been retrieved as a scalar by LWP::UserAgent). The script looks for everything in... -
Regular expression bug?
All of CF's RE functions act in a weird way, contrary to the documentation (both CF's own, and the underlying Java Regex docs). The special... -
Perl regular expression
Need a pattern to find string and words between braquets ??? -
Perl program need in regular expression
I want a program can read a log file and capture the character seg=9543 The file log line like this ... -
Regular Expression....?
Hi I am looking for the regular expression for validating the allowed file types to upload like files like "zip,pdf,doc,rtf,gif,jpg,png,txt"; and... -
Christian Winter #2
Re: Perl regular expression does not work on 5.8.0
"Stefan Rupp" <stefan.rupp@inform-ac.com> wrote:
Hi,> if ( /^\s*([^\s=]+)\s*=\s*([^\"]\S*|\".*\")\s*/ ) {
in some circumstances the [^\s] doesn't work in the standard
distribution of perl shipped with redhat 9, due to some utf8
bug. Upgrading your perl version or disabling utf8 support
for your locale should solve this.
HTH
-Christian
Christian Winter Guest
-
Stefan Rupp #3
Re: Perl regular expression does not work on 5.8.0
Good evening,
Thanks for the answer!
Christian Winter schrieb:How do I 'disable utf8 support' in RH 9? I'm more used to Debian, so> in some circumstances the [^\s] doesn't work in the standard
> distribution of perl shipped with redhat 9, due to some utf8
> bug. Upgrading your perl version or disabling utf8 support
> for your locale should solve this.
I'm unfamiliar with 'The RedHat way'.
The other option, to update perl, would be to go to perl 5.8.1 beta,
which I'd rather avoid. I'd need libdb-4.1.so for that as well.
Regards,
Stefan
Stefan Rupp Guest



Reply With Quote

