Re: regular expression help
| From: | Jochem Maas | Date: | Fri, 21 Jan 2005 18:49:14 +0000 |
| Subject: | Re: regular expression help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206966@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
Jason wrote:quite.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. function fix_mac( $mac ) { global $mac;It's really weird to both pass in $mac as an argument and to declare it global... Do one or the other, but not both.
Can't help you with the mess of Regex you've got though...now I bet you can actually, chicken and egg: you have to have the skill to recognise the mess. ;-) Jason - don't be dishearted: a, regexp are/can be hard b, anyone who is giving them a go, is probably trying hard to improve their skills (we like that :-)) - regexps are quite a hurdle for most people. c, we all start out writing regexps like yours (i.e. simple ones) and eventually they become more and more complex/arcane until you become Larry Wall. --- "did someone say 'who is Larry Wall?'?, 10 lashes for that man"