regex (preg_match) woes
I'm sorry if this has been asked before, but I just can't get a straight answer from the interwebs today!
I need to validate a form field and check if there are 3 and only 3 (no more, no less), uppercase letters.
My sorry attempts at regex have so far all failed - I thought tha开发者_StackOverflowt
/^[A-Z]{3}$/
would do the job, but nix. Any takers?!
/^[A-Z]{3}$/
Will check the string for ...
begining_of_the_string->three_and_only_tree_uppercase_letters->end_of_line
no other letters are valid in the string with this regexp.
But, I tried it with js regexp. And I think the same for php. Could you provide full code (or at least part of it) of your php script ?
精彩评论