Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
regex testing
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt McKeon  
View profile  
 More options Aug 15 2009, 9:50 pm
From: Matt McKeon <m...@mmckeon.com>
Date: Sat, 15 Aug 2009 21:50:27 -0400
Local: Sat, Aug 15 2009 9:50 pm
Subject: regex testing
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Finkler  
View profile  
 More options Aug 16 2009, 9:11 pm
From: Ed Finkler <funkat...@gmail.com>
Date: Sun, 16 Aug 2009 21:11:09 -0400
Local: Sun, Aug 16 2009 9:11 pm
Subject: Re: [inspekt] regex testing
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt McKeon  
View profile  
 More options Aug 17 2009, 10:03 pm
From: Matt McKeon <m...@mmckeon.com>
Date: Mon, 17 Aug 2009 22:03:02 -0400
Local: Mon, Aug 17 2009 10:03 pm
Subject: Re: [inspekt] Re: regex testing
hah, well I completely overlooked using ^ and $. Thanks, I'll have to go
play with that then.

Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »