PHP -> RegEx help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Other (
https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (
https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: PHP -> RegEx help (
/showthread.php?tid=264302)
PHP -> RegEx help -
*IsBack - 25.06.2011
Hi,
I found this regular expression for RP name check:
Код:
([A-Z]{1,1})[a-z]{2,9}+_([A-Z]{1,1})[a-z]{2,9}
(
topic) But it seems that it doesn't work in php (using preg_match function).
Anybody can fix this one or give me another one?
BTW I tried checking this one on
online checker and it seems that it actually doesn't work with RP names (like
First_Last)
EDIT: fixed
Код:
if(preg_match("/^([A-Z]{1,1})[a-z]{2,9}+_([A-Z]{1,1})[a-z]{2,9}$/",$PlayerName)) echo 'Works!';