note 87364 added to function.preg-match
| From: | Madbreaks at osu1 dot php dot net | Date: | Tue, 02 Dec 2008 04:18:46 +0000 |
| Subject: | note 87364 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147508@lists.php.net to get a copy of this message | ||
@Ronen, et al
It's good practice to avoid creating back-references if you're not going to use them. Do
so by replacing '(' with '(?:'.
Also, the final {1} is redundant since any match is matched exactly once by default (had to split
lines due to line length limitation by php.net) -
/^
(?:(?:1?\d{1,2}|2[0-4]\d|25[0-5])\.){3}
(?:1?\d{1,2}|2[0-4]\d|25[0-5])
$/
Nice regex though....are we having fun yet?
----
Server IP: 209.41.74.194
Probable Submitter: 66.220.104.38
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/87364
Del: integrated -- https://master.php.net/note/delete/87364/integrated
Del: useless -- https://master.php.net/note/delete/87364/useless
Del: bad code -- https://master.php.net/note/delete/87364/bad+code
Del: spam -- https://master.php.net/note/delete/87364/spam
Del: non-english -- https://master.php.net/note/delete/87364/non-english
Del: in docs -- https://master.php.net/note/delete/87364/in+docs
Del: other reasons-- https://master.php.net/note/delete/87364
Reject -- https://master.php.net/note/reject/87364
Search -- https://master.php.net/manage/user-notes.php