On Wed, Jul 31, 2002 at 07:21:04PM +0200, Eelco Alosery wrote: > I read whit LWP::Simple a url, and from that string i need the keywords. > > I use this script: > > > if ( $srting =~ s/<META NAME="keywords" CONTENT="(.+)">/$1/ig )
If you use .* inside the quotes then you may end up matching too much. Try this instead: s/<META\s+NAME="keywords"\s+CONTENT="([^"])"[^>]*>/$1/ig Of course, this won't work in all cases (for example, if the HTML contains single quotes, or the attributes are in a different order), but it may be enough for what you need. Ronald