Results 1 to 2 of 2
Radio Buttons Return Nothing Forum: HTML ForumReplies: 7
Automaticaly return to top of page Forum: HTML ForumReplies: 1
Installation Problem in perl dbi on windows-xp using DBI-1.38.tar Forum: CGI Perl ForumReplies: 0
Return Form Answers - Perl Forum: CGI Perl ForumReplies: 8
10-24-2006, 07:50 PM #1
trap carriage return - perl/windows
I'm trying to account for possible carriage returns in a file.
I'm looking for: <meta name="author" content="John Doe">
But sometimes there's extra spaces by accident or even a carriage return
This works fine for extra spaces:
/<meta *name="author" *content="[azAZ '-]?">/is
and this works fine for only carriage returns:
/<meta (\r|\n)name="author" (\r|\n)content="[azAZ '-]?">/is
and this works fine if there's only one or the other:
/<meta *(\r|\n)name="author" *(\r|\n)content="[azAZ '-]?">/is
but if there's spaces and carriage returns it doesn't work.
Oh, maybe it's (\r\n) without the or???
*note, i'm running my perl script against local files on a windows 2000 box, not Unix/Linux.
10-25-2006, 07:01 PM #2
Re: trap carriage return - perl/windows
a while ago i was working on a similer thing... and found it is much eassier if you do something more like this:
this is untested so probably wont work, but you get the idea. what it is SUPPOSED to do is trak everything in the in between the name's double quotes. and exclude \" so you can have a " in there and keep it from erroring.