[PHP] Re: regular expression help!

2007-01-18 Thread Al
First stripslashes() and all newlines [\n\r*]. It makes the regex much easier. $pattern= "%%i; preg_match($pattern, $string, $match); If more than one in the string, use preg_match_all(). Now print_r($match); so you can see the result. Now, read the doc and see why each term is used. Note, I

[PHP] Re: regular expression help

2005-01-21 Thread Jason
You were right, I removed the reference to global $mac and it started working great. Thanks. It seems sometimes another set of eyes to catch stuff really helps... thanks. Jason wrote: Jason wrote: Simple functions to check & fix if necessary invalid formating of a MAC address... I seem to be

Re: [PHP] Re: regular expression help

2005-01-21 Thread RaTT
Hi, >From what i can see you dont even need to call global, as your passing variables to the function ? this could be causing the script to confuse itself. hth On Fri, 21 Jan 2005 09:30:21 -0700, Jason <[EMAIL PROTECTED]> wrote: > Jason wrote: > > Simple functions to check & fix if necessary i

[PHP] Re: regular expression help

2005-01-21 Thread Jason
Jason wrote: Simple functions to check & fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. global $mac; if( eregi( "^[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-

[PHP] Re: Regular expression help?

2004-02-02 Thread Matthew Weier O'Phinney
* Jas <[EMAIL PROTECTED]>: > Not sure if anyone knows of a good way to match strings of this type... > 00:02:8b:0c:2f:09 > > I have tried this but its not working. > > !eregi("^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$",$

[PHP] Re: Regular Expression Help in my PHP! Sorry if wrong group

2003-01-15 Thread Jason Lehman
I figured out what I was doing wrong. My regexp should of looked like this /]*>(Tampa)<\/a>/ and that made it more specific and kept it to that match. Jason Lehman wrote: I have a script that turns certain words into links. That I am having no problems with, it is when I want to turn the link

[PHP] Re: regular expression help

2001-09-18 Thread _lallous
This should do (but ofcourse you might want to play a bit with it) $mem = ' http://www.mydomain.com/mypage.php";>something is fine http://www.yourdomain.com/yourpage.php";>something is wrong http://www.yourdomain.com/yourpage.php";>something is fine http://www.lgwm.org/";>lgwm http://www.google.c

Re: [PHP] Re: Regular Expression help

2001-06-30 Thread Brad Hubbard
On Fri, 29 Jun 2001 23:43, Clayton Dukes wrote: > Okay, here's what I have so far: > > ---snip--- > if ((!$email) > >|| ($email=="") >|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email)) > >) > $stop = ""._ERRORINVEMAIL.""; > ---snip--- > > This works, but how can I add a

Re: [PHP] Re: Regular Expression help

2001-06-30 Thread J Smith
Clayton Dukes wrote: > Okay, here's what I have so far: > > ---snip--- > if ((!$email) >|| ($email=="") >|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email)) >) > $stop = ""._ERRORINVEMAIL.""; > ---snip--- > > This works, but how can I add a second domain? > ie: > Tr

[PHP] Re: Regular Expression help

2001-06-29 Thread Clayton Dukes
Okay, here's what I have so far: ---snip--- if ((!$email) || ($email=="") || (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email)) ) $stop = ""._ERRORINVEMAIL.""; ---snip--- This works, but how can I add a second domain? ie: ---snip--- if ((!$email) || ($email=="")