[thelist] Perl regexp question

Richard Bennett richard.bennett at skynet.be
Tue Sep 3 15:43:00 CDT 2002


Hi,
<----- Original Message -----
<From: "Geoff Sheridan" <web2k2 at premonition.co.uk>
<Why not try cleaning up the string first
<Why not:
<convert entire string to lower case
<check for substring "main"
<if found return value "main"
<way why not just strip
<them out first, and then hit the tidy sting with a simpler regEx?

Yes, that could be a good approach, but in this case I'm looping through
each line of an email checking if the keyword is there.
So I don't want to convert all the lines to lower-case, or strip all
white-space/quotes before I'm sure I've got the right line.
Thanks for the idea though.

<----- Original Message -----
<From: "Carlos Costa Portela" <ccosta at servidores.net>
<Try with
<$line = "project = main";
<($data,$value) = split("=",$line);
<$value =~ s/\ //g;

Also a good idea, but with the same limitation, I'd need to do it to each
line of the email, which would give wrong results if there was another =
somewhere.

It seems my problem wasn't so much with the reqexp, but with users sending
html email.
For some reason the string changed to:
project=3Dmain instead of project=main.

Does anyone know where the 3D comes from, and whether it's a fixed value I
can parse out, or whether it could change?

Thanks,
Richard.




More information about the thelist mailing list