Hi all, sorry for the rubbish post title but i've no clue what else to call this!
Pretty new to regular expressions (and do everything in my power to avoid them normally), and can't seem to figureout how to get it to do what I want, any help would be appreciated.
I'm looking to validate a string by checking it matches the following pattern and rules;
- String must start with either D, M or Y (singular)
- Above must be followed by at least one number
- First condition must only be followed by numbers
I've got this so far, but because im matching a 'pattern' it will validate things like M333D333 - I havent managed to get the bit to say "followed by any number of digits, and only digits to the end of the string.
preg_match('/^(d|m|y)[0-9]/'
Should probably say I'm using whatever the default PHP regular expression engine is. Any tips would be great - this obscure language is driving me insane!
Cheers,
DM