<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023750" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023750</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145904</link>
    <description> &lt;p&gt;no worries &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;it&#039;s good to see the many ways of doing things, and learning from errors.&lt;/p&gt;
&lt;p&gt;Everyday is a learning day **now if only my small brain would contain it all**&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Feb 2004 06:10:06 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1145904 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145868</link>
    <description> &lt;p&gt;Ah, yes, thank you.&lt;/p&gt;
&lt;p&gt;So, fixed. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt; And I feel illuminated! Sorry for hijacking your thread in my quest to understand the world. heh.&lt;/p&gt;
 </description>
     <pubDate>Tue, 17 Feb 2004 16:46:51 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145868 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145850</link>
    <description> &lt;p&gt;kinda weird having a function named after you &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;the {6,} allows minimum of 6 numbers, change it to {6} for just 6&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: Busy&lt;br /&gt;
your trying to find (id=&#039;12345678&#039;)&lt;br /&gt;
Suzanne&lt;br /&gt;
You entered: 12345678&lt;br /&gt;
It should be not 6 numbers only. [12345678] is 8 characters long.&lt;br /&gt;
Suzanne No-Regs, No Strlen&lt;br /&gt;
You entered: 12345678&lt;br /&gt;
It should be 6 numbers only. [12345678] is 8 characters long.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; Only because you have this line&lt;code&gt;$suzchar == &amp;#039;6&amp;#039; &amp;amp;&amp;amp; ereg(&amp;quot;([0-9]{6,})&lt;/code&gt;&#039; in suzanne function; suzchar == 6 but ereg &amp;gt;= 6&lt;br /&gt;
everything else seems to work ok on all three&lt;/p&gt;
 </description>
     <pubDate>Tue, 17 Feb 2004 07:50:30 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1145850 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145830</link>
    <description> &lt;p&gt;I updated &lt;a href=&quot;http://www.synapticimpulse.com/testy.php&quot; class=&quot;bb-url&quot;&gt;this&lt;/a&gt;. I&#039;m getting varied results. Perhaps it&#039;s just me.&lt;/p&gt;
&lt;p&gt;No, the problem seems to be that without strlen, the all numbers version is getting through even if more than 6 characters.&lt;/p&gt;
 </description>
     <pubDate>Tue, 17 Feb 2004 00:04:09 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145830 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145825</link>
    <description> &lt;p&gt;only difference to my version is I&#039;m not using the $regs, nor the $_GET ($_POST in your sample) as the content is trimed and striped etc before being checked for length and numbers.&lt;br /&gt;
try just the number check without isset or globals&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;	if(ereg(&amp;quot;^[0-9]{6,}$&amp;quot;,$title))&lt;br /&gt;	{&lt;br /&gt;	 	$answer = &amp;quot; (id=&amp;#039;&amp;quot;.$title.&amp;quot;&amp;#039;)&amp;quot;;&lt;br /&gt;	}else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $answer = &amp;quot; (title like &amp;#039;%&amp;quot;.$title.&amp;quot;%&amp;#039;)&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;your trying to find &amp;quot; .$answer;&lt;/code&gt;&lt;/div&gt;&#039; should work fine, is on mine, will only prove true if the number is 6+ numbers only, any letters included it proves false&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 21:02:47 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1145825 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145795</link>
    <description> &lt;p&gt;I amended the demo to match that, Busy, it doesn&#039;t work for me?&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 15:53:58 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145795 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145787</link>
    <description> &lt;p&gt;if(ereg(&quot;^[0-9]{6,}$&quot;,$titled))&lt;br /&gt;
	{&lt;br /&gt;
           is numbers&lt;br /&gt;
        }else{&lt;br /&gt;
            isn&#039;t 6+ numbers&lt;br /&gt;
         }&lt;/p&gt;
&lt;p&gt;works, 6+ numbers only = true, numbers and letters = false&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 05:11:20 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1145787 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145786</link>
    <description> &lt;p&gt;yeah sorted the 1-9 and 0-9 thing, but with the search, I want two options&lt;/p&gt;
&lt;p&gt;one if looking for &#039;contains&#039; will find cat, catch, catty, cathy ... but also want one that will find &#039;exact&#039; matches only, search for &#039;cat&#039; will find &quot;cat&quot; or &quot;cat and dog&quot;, &quot;smelly cat&quot; etc.&lt;/p&gt;
&lt;p&gt;problem i have is looking in db rows it will only find &quot;cat&quot;, wont find anything else, like &quot;cat and dog&quot;&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 05:07:33 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1145786 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145784</link>
    <description> &lt;p&gt;Mark, when I tried that I was getting false positive matches for things like abc123456xyz. ?&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 05:03:08 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145784 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/ereg-problem#comment-1145781</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Busy wrote:&lt;/strong&gt; sorted it out, (ereg(&quot;^[0-9]{6}$&quot;,$title)) works but (ereg(&quot;^[1-9]{6}$&quot;,$title)) doesn&#039;t only difference is one starts with 0, the other 1.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Woah!  Be careful there. That wont match any numbers with a zero in it.  So it wont match &quot;100000&quot; or &quot;123450&quot;, etc.&lt;/p&gt;
&lt;p&gt;Try:&lt;br /&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ereg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;^([0-9]{6})$\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039;], &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$regs&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;id= &#039;. &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$regs&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot;title like &#039;%\&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . \&quot;%&#039;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;The string length match is performed in the ereg().  Only a 6 digit number will be accepted.  Everything else will fail.&lt;/p&gt;
&lt;p&gt;&quot;%cat%&quot; will match &quot;cat&quot; as well as any string with &quot;cat&quot; in it (begining/ending with or containing).&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Feb 2004 02:54:32 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1145781 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
