NeoPlosive Posted July 24, 2009 Posted July 24, 2009 I'm doing a recoding of SourceBans which is a Steam ID banning system for Multiplayer Online Games (released under Creative Commons). I'm a bit useless with RegEx - theres a validation line which validates Steam IDs define('STEAM_FORMAT', "^STEAM_[0-9]:[0-9]:[0-9]+$"); Steam IDs are STEAM_x:x:xxxxxxxxx I want to change it so it validates Punkbuster GUIDs instead. These are 32 characters log and alphanumeric. i.e. 299f51c289005b05069057e94938afec 3dbacc0e7126a796c60834b832526c49 Any suggestions?
NeoPlosive Posted July 24, 2009 Author Posted July 24, 2009 This may have been one Google Search too soon! ^[a-zA-Z0-9]+$ seems to do the trick - going to test it properly and will post if any problems.
keithu Posted July 24, 2009 Posted July 24, 2009 If you want to match exactly 32 characters you can do it like this (assuming your regex library supports this syntax): ^[a-zA-Z0-9]{32}$ 1
NeoPlosive Posted July 24, 2009 Author Posted July 24, 2009 Both very good points! Shall give the {32} a try. I would have tweaked, eventually, getting a bit tired of coding now been doing it all day.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now