<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1032045" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1032045</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1188011</link>
    <description> &lt;p&gt;you will need to loop through the result set after executing the regexp.&lt;/p&gt;
 </description>
     <pubDate>Tue, 13 Dec 2005 15:21:50 +0000</pubDate>
 <dc:creator>Neutron2k</dc:creator>
 <guid isPermaLink="false">comment 1188011 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187994</link>
    <description> &lt;p&gt;Thanks CptAwesome!  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/grin.png&quot; title=&quot;Laugh&quot; alt=&quot;Laugh&quot; class=&quot;smiley-content&quot; /&gt;  &lt;/p&gt;
&lt;p&gt;This is what I was looking for...&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;br /&gt;
Andrew Schools&lt;/p&gt;
 </description>
     <pubDate>Tue, 13 Dec 2005 13:41:04 +0000</pubDate>
 <dc:creator>codehungry</dc:creator>
 <guid isPermaLink="false">comment 1187994 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187797</link>
    <description> &lt;p&gt;actuallt one small change to that and an example&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;?&lt;br /&gt;$message = &amp;quot;&lt;br /&gt;&amp;lt;a href=&amp;#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;#039;&amp;gt;image&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a target=\&amp;quot;_blank\&amp;quot; href=&amp;#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;#039;&amp;gt;image&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;#039; target=\&amp;quot;_blank\&amp;quot;&amp;gt;image&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href=\&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;gt;image&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$regex = &amp;quot;(&amp;lt;a)?([A-z0-9 -=\&amp;quot;\&amp;#039;])+(href=)+(\&amp;#039;|\&amp;quot;)+([A-z0-9\:\/\-_\.]{1,255})+(\.gif)+(\&amp;#039;|\&amp;quot;)?([A-z0-9 -=\&amp;quot;\&amp;#039;])+&amp;gt;+[[:alnum:][:punct:]]+&amp;lt;/a&amp;gt;&amp;quot;;&lt;br /&gt;$message = ereg_replace($regex,&amp;quot;&amp;lt;img src=\&amp;quot;\\5\\6\&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;\n&amp;quot;,$message);&lt;br /&gt;echo $message;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;returns:&lt;br /&gt;&amp;lt;img src=&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;img src=&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;img src=&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;img src=&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 11 Dec 2005 09:41:10 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1187797 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187795</link>
    <description> &lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$message = &amp;quot;&amp;lt;a href=&amp;#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;#039;&amp;gt;image&amp;lt;/a&amp;gt; &amp;lt;a &lt;br /&gt;&lt;br /&gt;href=&amp;#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;#039;&amp;gt;image&amp;lt;/a&amp;gt;&amp;quot;; &lt;br /&gt;$regex = &amp;quot;(&amp;lt;a)?([A-z0-9 -=\&amp;quot;\&amp;#039;])+(href=)+(\&amp;#039;|\&amp;quot;)+([A-z0-9\:\/\-_\.]{1,255})+(\.gif)+(\&amp;#039;|\&amp;quot;)+&amp;gt;+[[:alnum:][:punct:]]+&amp;lt;/a&amp;gt;&amp;quot;;&lt;br /&gt;$message = ereg_replace($regex,&amp;quot;&amp;lt;img src=\&amp;quot;\\5\\6\&amp;quot;&amp;gt;&amp;lt;br /&amp;gt;\n\n&amp;quot;,$message);&lt;br /&gt;echo $message;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 11 Dec 2005 09:37:02 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1187795 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187703</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
A proublem with your Regual Expression string...&lt;br /&gt;
add &quot;http://www.&quot; to the first section.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I&#039;ve been using &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;(http://|https://|www.|ftp://)+&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;that will match everything I need.  Looking at the previous code, I must have changed it in my attempt to fix the problem.  Here&#039;s the new code:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$message &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;a href=&#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&#039;&amp;gt;image&amp;lt;/a&amp;gt; &amp;lt;a href=&#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&#039;&amp;gt;image&amp;lt;/a&amp;gt;\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = ereg_replace(\&quot;(&amp;lt;a href=&#039;((http://|https://|www.|ftp://)+([[:alnum:]]|[[:punct:]])+\.gif)&#039;&amp;gt;([[:alnum:]]|[[:punct:]]|[[:blank:]])+&amp;lt;/a&amp;gt;)\&quot;,\&quot;&amp;lt;img target=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;_blank&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; src=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;
Andrew Schools&lt;/p&gt;
 </description>
     <pubDate>Sat, 10 Dec 2005 04:41:17 +0000</pubDate>
 <dc:creator>codehungry</dc:creator>
 <guid isPermaLink="false">comment 1187703 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187674</link>
    <description> &lt;p&gt;Hi, I get the following output:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;img target=&amp;quot;_blank&amp;quot; src=&amp;quot;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;
Andrew Schools&lt;/p&gt;
 </description>
     <pubDate>Sat, 10 Dec 2005 00:23:18 +0000</pubDate>
 <dc:creator>codehungry</dc:creator>
 <guid isPermaLink="false">comment 1187674 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187669</link>
    <description> &lt;p&gt;Well, ill give you 2 choices.&lt;br /&gt;
1) wait for someone who knows php to answer the thread. (Eveyone else but me)&lt;br /&gt;
2) Show me the output of the string you parced and hope I can come up with the answer.&lt;/p&gt;
 </description>
     <pubDate>Fri, 09 Dec 2005 23:35:48 +0000</pubDate>
 <dc:creator>bja888</dc:creator>
 <guid isPermaLink="false">comment 1187669 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187668</link>
    <description> &lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I did only run the ereg_replace() function once, however, it’s supposed to find every occurrence and replace it.  For example, if I run the following script:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$message &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;I went to the store and got a gallon of milk and a loaf of bread.\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = ereg_replace(\&quot;(a[[:alpha:]]d)\&quot;,\&quot;---\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;My output is the following:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;I went to the store --- got a gallon of milk --- a loaf of bread.&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;
Andrew Schools&lt;/p&gt;
 </description>
     <pubDate>Fri, 09 Dec 2005 23:27:16 +0000</pubDate>
 <dc:creator>codehungry</dc:creator>
 <guid isPermaLink="false">comment 1187668 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187662</link>
    <description> &lt;p&gt;I am not familior with php but Regular expressions have been something I have used in other languages. It might be that you only ran the ereg_replace() only onece.&lt;/p&gt;
&lt;p&gt;A proublem with your Regual Expression string...&lt;br /&gt;
add &quot;http://www.&quot; to the first section.&lt;/p&gt;
 </description>
     <pubDate>Fri, 09 Dec 2005 23:08:24 +0000</pubDate>
 <dc:creator>bja888</dc:creator>
 <guid isPermaLink="false">comment 1187662 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-regular-expression-logical-error#comment-1187658</link>
    <description> &lt;p&gt;Hi bja888,&lt;/p&gt;
&lt;p&gt;This is the string I&#039;m parsing:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$message &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;a href=&#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&#039;&amp;gt;image&amp;lt;/a&amp;gt; &amp;lt;a href=&#039;http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif&#039;&amp;gt;image&amp;lt;/a&amp;gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;
Andrew Schools&lt;/p&gt;
 </description>
     <pubDate>Fri, 09 Dec 2005 22:53:44 +0000</pubDate>
 <dc:creator>codehungry</dc:creator>
 <guid isPermaLink="false">comment 1187658 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
