Jump to content

Recommended Posts

Posted

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?

Posted

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}$

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...