note 81894 added to function.preg-match

From: Date: Tue, 18 Mar 2008 10:55:06 +0000
Subject: note 81894 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-137160@lists.php.net to get a copy of this message
Thought this might be helpful to those people out there writing code for use with Valves steam id's: <?php $steam_id = "STEAM_0:1:1234567890"; $pattern = "/^STEAM_[0-2]:[0-2]:[0-9]{1,10}$/"; if (preg_match($pattern, $team_id)) { echo "Valid Steam ID"; } else { echo "Not Valid Steam ID"; } // output: // Valid Steam ID ?> ---- Server IP: 203.16.234.91 Probable Submitter: 203.91.84.88 (proxied: 203.91.84.88) ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/81894 Del: integrated -- https://master.php.net/note/delete/81894/integrated Del: useless -- https://master.php.net/note/delete/81894/useless Del: bad code -- https://master.php.net/note/delete/81894/bad+code Del: spam -- https://master.php.net/note/delete/81894/spam Del: non-english -- https://master.php.net/note/delete/81894/non-english Del: in docs -- https://master.php.net/note/delete/81894/in+docs Del: other reasons-- https://master.php.net/note/delete/81894 Reject -- https://master.php.net/note/reject/81894 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137160) next »