<?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: Using regular expressions to extract content</title>
	<atom:link href="http://www.askaboutphp.com/25/regex-extract-content.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.askaboutphp.com/25/regex-extract-content.html</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 06:32:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mustafa Rampurawala</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-40527</link>
		<dc:creator>Mustafa Rampurawala</dc:creator>
		<pubDate>Sat, 04 Jun 2011 19:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-40527</guid>
		<description>nope? unfortunately can&#039;&#039;t get it to show correct code, but in this code have also taken the care if the href tag is not just after the a tag, the code i have tested works great.

Hope webmaster can fix this so that others may benifit from it</description>
		<content:encoded><![CDATA[<p>nope? unfortunately can&#8221;t get it to show correct code, but in this code have also taken the care if the href tag is not just after the a tag, the code i have tested works great.</p>
<p>Hope webmaster can fix this so that others may benifit from it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mustafa Rampurawala</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-40526</link>
		<dc:creator>Mustafa Rampurawala</dc:creator>
		<pubDate>Sat, 04 Jun 2011 19:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-40526</guid>
		<description>$regex = &#039;#((?:(?!).)*)#i&#039;;

hope this works,</description>
		<content:encoded><![CDATA[<p>$regex = &#8216;#((?:(?!).)*)#i&#8217;;</p>
<p>hope this works,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mustafa Rampurawala</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-40525</link>
		<dc:creator>Mustafa Rampurawala</dc:creator>
		<pubDate>Sat, 04 Jun 2011 19:40:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-40525</guid>
		<description>sorry the code is just messed up :( will try to post again with pre tags, if it works

&lt;pre&gt;$regex = &#039;#&lt;a&gt;((?:(?!&lt;/a&gt;).)*)&lt;/a&gt;#i&#039;;

$string = &#039;&#039;; // however you like get your string for input

preg_match_all($regex,$string,$matches);
print_r($matches);
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>sorry the code is just messed up <img src='http://www.askaboutphp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  will try to post again with pre tags, if it works</p>
<pre>$regex = '#<a>((?:(?!</a>).)*)#i';

$string = ''; // however you like get your string for input

preg_match_all($regex,$string,$matches);
print_r($matches);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mustafa Rampurawala</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-40524</link>
		<dc:creator>Mustafa Rampurawala</dc:creator>
		<pubDate>Sat, 04 Jun 2011 19:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-40524</guid>
		<description>well this looks to be quite old post, but just in case some one like me comes here searching for a preg_match_all code for extracting links, here is what i finally came up with. 

$regex = &#039;#&lt;a&gt;((?:(?!&lt;/a&gt;).)*)&lt;/a&gt;#i&#039;;

$sting = &quot;&quot;; //get your data from anywhere and any how you like

preg_match_all($regex,$string,$matches);
print_r($matches);

This code properly extracts all the links, with the text between the &lt;a&gt; tag.

Hope its helpful to some one like me :)

By the way thanks a lot to you all guys, this post was also a climbing step for me to achive my goal.</description>
		<content:encoded><![CDATA[<p>well this looks to be quite old post, but just in case some one like me comes here searching for a preg_match_all code for extracting links, here is what i finally came up with. </p>
<p>$regex = &#8216;#<a>((?:(?!</a>).)*)#i&#8217;;</p>
<p>$sting = &#8220;&#8221;; //get your data from anywhere and any how you like</p>
<p>preg_match_all($regex,$string,$matches);<br />
print_r($matches);</p>
<p>This code properly extracts all the links, with the text between the <a> tag.</p>
<p>Hope its helpful to some one like me <img src='http://www.askaboutphp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>By the way thanks a lot to you all guys, this post was also a climbing step for me to achive my goal.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fahad</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-18065</link>
		<dc:creator>Fahad</dc:creator>
		<pubDate>Mon, 04 Jan 2010 02:43:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-18065</guid>
		<description>Thank you man that helped me a lot</description>
		<content:encoded><![CDATA[<p>Thank you man that helped me a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denisa</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-13889</link>
		<dc:creator>Denisa</dc:creator>
		<pubDate>Fri, 04 Sep 2009 10:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-13889</guid>
		<description>Hi! I have a question...How can I extract only some links whici have a specific title?? Is it possible to do this? I want to obtain the link from this
&lt;a title=&quot;Go to Next Page&quot; href=&quot;castle-moat-02.html&quot; rel=&quot;nofollow&quot;&gt;Next &#xBB;&lt;/a&gt;
so, only the a href with the title= &quot;Go to Next Page&quot;.
Thank very much! Maybe you can help me.
Denisa</description>
		<content:encoded><![CDATA[<p>Hi! I have a question&#8230;How can I extract only some links whici have a specific title?? Is it possible to do this? I want to obtain the link from this<br />
<a title="Go to Next Page" href="castle-moat-02.html" rel="nofollow">Next &#xBB;</a><br />
so, only the a href with the title= &#8220;Go to Next Page&#8221;.<br />
Thank very much! Maybe you can help me.<br />
Denisa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nimtronican</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-11392</link>
		<dc:creator>nimtronican</dc:creator>
		<pubDate>Tue, 23 Jun 2009 09:29:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-11392</guid>
		<description>Thanks a lot man... it was really helpful!</description>
		<content:encoded><![CDATA[<p>Thanks a lot man&#8230; it was really helpful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-10250</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 27 May 2009 22:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-10250</guid>
		<description>thanks 

but i figured it out</description>
		<content:encoded><![CDATA[<p>thanks </p>
<p>but i figured it out</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-10248</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 27 May 2009 21:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-10248</guid>
		<description>I am having a major problem, with my web site. I edited a php file, and now that page will not load. The rest of the site works fine, just that page. I have backup of those php files, so i reloaded that page, still does not work. Is there other files that are capable of corrupting when updating a php file.

  Thanks so much

Tim</description>
		<content:encoded><![CDATA[<p>I am having a major problem, with my web site. I edited a php file, and now that page will not load. The rest of the site works fine, just that page. I have backup of those php files, so i reloaded that page, still does not work. Is there other files that are capable of corrupting when updating a php file.</p>
<p>  Thanks so much</p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: webmaster</title>
		<link>http://www.askaboutphp.com/25/regex-extract-content.html/comment-page-1#comment-9752</link>
		<dc:creator>webmaster</dc:creator>
		<pubDate>Mon, 18 May 2009 02:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=25#comment-9752</guid>
		<description>hi Eric, sorry about that. Erm..., how do i stop that from happening in wordpress?
thanks</description>
		<content:encoded><![CDATA[<p>hi Eric, sorry about that. Erm&#8230;, how do i stop that from happening in wordpress?<br />
thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

