I’d be inclined to use the ctype_alnum() function instead of regex seen as it isn’t really necessary in this instance. Its usage is simple: it returns TRUE if all characters are alphanumerical, or FALSE if they’re not.
In order for your pattern to be reliable, you’ll need to use the $ anchor at the end of the pattern to ensure that the whole string contains only numbers and letters.