graviton747
New Member
I need a regex that checks if a string only contain letters(a-z) and that the first letter is uppercase, you cant have 2 letters in a word uppercase Like: THomas or THomAS but Thomas Anderson (Thomas anderson too) would be validlook:\[code\]The Magician Of The Elfs\[/code\] would be valid but not \[code\]ThE MaGiCiAN oF ThE ELFS\[/code\]\[code\]if (!preg_match("??", $name)) { echo "Invalid name!";}\[/code\]hope you understand!TomaszInvalid:\[code\]MaGIciaN Of The ELFz\[/code\]
\[code\]THomas anderson\[/code\]Valid:\[code\]Magician of the elfs\[/code\]
\[code\]Magician Of the Elfs\[/code\]
\[code\]Magician of The elfs\[/code\]
\[code\]Thomas Anderson\[/code\]
\[code\]Thomas anderson\[/code\]Basically i dont want it to be possible to have more than 1 capitalized letter in a word, not sentence.
\[code\]THomas anderson\[/code\]Valid:\[code\]Magician of the elfs\[/code\]
\[code\]Magician Of the Elfs\[/code\]
\[code\]Magician of The elfs\[/code\]
\[code\]Thomas Anderson\[/code\]
\[code\]Thomas anderson\[/code\]Basically i dont want it to be possible to have more than 1 capitalized letter in a word, not sentence.