List Info

Thread: Regex




Regex
country flaguser name
United States
2007-09-06 11:57:33

Hi,
#!/usr/bin/perl -w
my $path = shift;
my $machine = shift;
my (undef,$country,$property) = split ///,$path;
my $xmlData = qx!./pindown.php $machine!;
my contacts = $xmlData =~ /property name=";$property" country=&quot;$country">;.+?<contact type=";admin&quot;>.+?&lt;/contact&gt;/is;
#print "$&amp;n";
print contacts;

This prints "1&quot;
But printing $& prints a block of XML.
Why does the array contacts not contain the pattern matched?

Thanks,
Kapil.V

---------------------------------
Yahoo! Answers - Get better answers from someone who knows. Tryit now.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )