preg_match确保string中的第一个字符是大写或小写字母

can someone show me the regex for this preg_match. I want to make sure first letter in string is nothing but a letter, either uppercase or lowercase. thanks. I found this, but it doesnt seem to be working.

var_dump(preg_match("^/[A-Za-z]+/", $search_terms ));

The line above returns false, every time.

What about something like this, for your regex :

/^[A-Za-z]/
  • Begins with : ^
  • One character that is a letter : [A-Za-z]

The ^ symbol should be at the beginning of the regex, but inside its delimiters ;-)

"^/[A-Za-z]+/" should be "/^[A-Za-z]+/"