<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Parse html with PHP preg_match_all</title>
	<atom:link href="http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/</link>
	<description>Read about Website Development, Online Marketing and Web Hosting</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:28:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: dedi</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-144118</link>
		<dc:creator>dedi</dc:creator>
		<pubDate>Sun, 08 Jan 2012 14:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-144118</guid>
		<description>thanks fellow, u save my live..
i was edited your code to fit my need, here it is

$pattern = preg_match_all(&#039;!imgurl=.+\.(?:jpe?g&#124;png&#124;gif)!Ui&#039; , $data , $images);</description>
		<content:encoded><![CDATA[<p>thanks fellow, u save my live..<br />
i was edited your code to fit my need, here it is</p>
<p>$pattern = preg_match_all(&#8216;!imgurl=.+\.(?:jpe?g|png|gif)!Ui&#8217; , $data , $images);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129585</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Thu, 01 Sep 2011 07:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129585</guid>
		<description>Hi,
It&#039;s possible that you need to change the REGEX pattern a little. This tutorial is just an example on how-to use the function preg_match_all().
Compare your HTML with the pattern you&#039;re using at the moment, I&#039;m sure you will see the difference ;)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
It&#8217;s possible that you need to change the REGEX pattern a little. This tutorial is just an example on how-to use the function preg_match_all().<br />
Compare your HTML with the pattern you&#8217;re using at the moment, I&#8217;m sure you will see the difference <img src='http://cdn.web-development-blog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: criscmaia</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129495</link>
		<dc:creator>criscmaia</dc:creator>
		<pubDate>Wed, 31 Aug 2011 20:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129495</guid>
		<description>Hello, very good job here!

But, not working for me.
I have this directory (http://familiagrissi.com/images/arvore/) and want to select only the name of the pictures with the .jpg extension, but without the extension in an array.

the result should be something like:
$image[0] = Adelia Grissi Borgo;
$image[1] = Andrea BergaminiReis;

and so on...

thanks! :D</description>
		<content:encoded><![CDATA[<p>Hello, very good job here!</p>
<p>But, not working for me.<br />
I have this directory (<a href="http://familiagrissi.com/images/arvore/" >http://familiagrissi.com/images/arvore/</a>) and want to select only the name of the pictures with the .jpg extension, but without the extension in an array.</p>
<p>the result should be something like:<br />
$image[0] = Adelia Grissi Borgo;<br />
$image[1] = Andrea BergaminiReis;</p>
<p>and so on&#8230;</p>
<p>thanks! <img src='http://cdn.web-development-blog.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129109</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sun, 28 Aug 2011 13:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-129109</guid>
		<description>Hello Lan,
the pattern is wrong, it&#039;s not specific (you accept the whole string inside the $content var)</description>
		<content:encoded><![CDATA[<p>Hello Lan,<br />
the pattern is wrong, it&#8217;s not specific (you accept the whole string inside the $content var)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lan</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-128744</link>
		<dc:creator>Lan</dc:creator>
		<pubDate>Thu, 25 Aug 2011 10:57:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-128744</guid>
		<description>hello, thank for sharing.

i want to get one  of my html. My code like that: 
$url = &quot;index.html&quot;;
$content = file_get_contents($url);
$patten = &#039;/\(.*)\/&#039;;
preg_match_all($patten, $content, $data);
print($data);

result return empty. Help me. Thanks a lot</description>
		<content:encoded><![CDATA[<p>hello, thank for sharing.</p>
<p>i want to get one  of my html. My code like that:<br />
$url = &#8220;index.html&#8221;;<br />
$content = file_get_contents($url);<br />
$patten = &#8216;/\(.*)\/&#8217;;<br />
preg_match_all($patten, $content, $data);<br />
print($data);</p>
<p>result return empty. Help me. Thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127018</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Mon, 11 Apr 2011 07:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127018</guid>
		<description>Hi, 

your example doesn&#039;t work since your example URL is not valid ;)

@ssultan, if you need to extract the domain or hostname from some URL, try parse_url()</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>your example doesn&#8217;t work since your example URL is not valid <img src='http://cdn.web-development-blog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>@ssultan, if you need to extract the domain or hostname from some URL, try parse_url()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OnLine</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127014</link>
		<dc:creator>OnLine</dc:creator>
		<pubDate>Sun, 10 Apr 2011 16:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127014</guid>
		<description>Hy ssultan
Try this:

$regexp = &#039;#href=[&quot;&#124;\&#039;]http://(.[^/]+)([^&quot;&#124;\&#039;]+)#i&#039;;
$url = &#039;a hyperlink&#039;;

if (preg_match($regexp, $url, $matches)) {
  echo &#039;Domain: &#039;. $matches[1];
  echo &#039;Rest: &#039;. $matches[2];
}</description>
		<content:encoded><![CDATA[<p>Hy ssultan<br />
Try this:</p>
<p>$regexp = &#8216;#href=["|\']http://(.[^/]+)([^"|\']+)#i&#8217;;<br />
$url = &#8216;a hyperlink&#8217;;</p>
<p>if (preg_match($regexp, $url, $matches)) {<br />
  echo &#8216;Domain: &#8216;. $matches[1];<br />
  echo &#8216;Rest: &#8216;. $matches[2];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127005</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Fri, 08 Apr 2011 13:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127005</guid>
		<description>Hi ssultan,

which part of the URL do you need? Please provide some examples (or use the function parse_url())</description>
		<content:encoded><![CDATA[<p>Hi ssultan,</p>
<p>which part of the URL do you need? Please provide some examples (or use the function parse_url())</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ssultan</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127002</link>
		<dc:creator>ssultan</dc:creator>
		<pubDate>Fri, 08 Apr 2011 09:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-127002</guid>
		<description>I need help to extract the url which does not contain the primary domain.</description>
		<content:encoded><![CDATA[<p>I need help to extract the url which does not contain the primary domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-126982</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sun, 03 Apr 2011 06:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/#comment-126982</guid>
		<description>You&#039;re welcome Charleston, sure web development exists as long as the web ;)</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome Charleston, sure web development exists as long as the web <img src='http://cdn.web-development-blog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Database Caching 26/36 queries in 0.018 seconds using disk: basic
Object Caching 490/494 objects using disk: basic
Content Delivery Network via cdn.web-development-blog.com

Served from: www.web-development-blog.com @ 2012-02-08 10:24:50 -->
