hah, well I completely overlooked using ^ and $. Thanks, I'll have to go
Ed Finkler wrote:
> isRegex simply should return true if the regex finds a match in the
> input. You could give it a different regex if you wanted to make sure
> the entire input was matched (start with ^, end with $, etc).
> --
> Ed Finkler
> http://funkatron.com
> Twitter:@funkatron
> AIM: funka7ron
> ICQ: 3922133
> XMPP:funkat...@gmail.com
> On Sat, Aug 15, 2009 at 9:50 PM, Matt McKeon<m...@mmckeon.com> wrote:
>> I was testing some regex patterns with isRegex and wasn't quite sure
>> about the results that were returned. My thought going into it was that
>> isRegex would return true if the *whole* $value matched the $pattern,
>> but that doesn't seem to be the case.
>> Here's my quick test http://pastebin.com/m484c4d5c
>> You can see where I added a check to capture the matches in preg_match
>> directly and compare $matches[0] to the supplied string. As per the php
>> docs[0] $matches[0] always returns the whole match. Maybe this test is
>> what should be returned instead of the return value of preg_match?
>> Is my thinking here correct? If not, what is the intended behavior of
>> isRegex?
>> Thanks,
>> Matt
>> [0] http://us3.php.net/manual/en/function.preg-match.php