Gossamer Forum
Home : General : Perl Programming :

modifying a search script

Quote Reply
modifying a search script
I'm modifying a search script and am trying to get the script to search ALT tags in my webpages. The code I'm using is:

if ($string =~ s/<[^>]*\s+ALT\s*=\s*"(([^>"])*)"[^>]*>/$1/ig)
{
@cut = split(/\">/,$1);
$alt = $cut[0];
for ($i=0;$i<$alt_x;$i++)
{
$string .= $alt;
}
}

Right now, the script only recognizes ALT tags that are capitalized. The script will recognize ALT=Box but not ALT=box. Also, how do I get the script to search the whole alt tag, ie. search "Turtle" and it will find an instance for ALT="box turtle" Any and all info appreciated.

Mike
Quote Reply
Re: [mikeloi] modifying a search script In reply to
Anyone? I'm a newbie and just need to figure out how to have that part of code search all of the ALT tag including anything lowercase. Any help appreciated.

Mike