Re: [MacPerl-AnyPerl] verifing a string

[email protected] (Chris Nandor) Wed, 31 Jul 2002 17:10:43 -0400
Newsgroups perl.macperl.anyperl
Message-ID <p05111b09b96e02aa5818@[10.0.1.177]>
At 23:03 +0200 2002.07.31, Multi-Graphics wrote:
>> $srting =~ s/<META NAME="keywords" CONTENT="(.+)".*?>/$1/igs
>>
>This script line isn't working when the $srting contains
>
>>> if the string contans for example this:
>>> <META NAME="keywords" CONTENT="
>>> test, good">
>
>after CONTENT=" is a new line, and the script will not see the keywords.
>I have tryed to put .*? somware else but whit no result.
>
>Any other sugestions will be very welkom.

It seems to work for me.

	$srting = '<META NAME="keywords" CONTENT="
	test, good">';

	$srting =~ s/<META NAME="keywords" CONTENT="(.+)".*?>/$1/igs;
	print $1;

Returns:

	test, good

-- 
Chris Nandor                      [email protected]    http://pudge.net/
Open Source Development Network    [email protected]     http://osdn.com/