「phpの入門」php正規表現サンプル

PHPコード:

“^\d+$"
“^[0-9]*[1-9][0-9]*$"
“^((-\d+)|(0+))$"
“^-[0-9]*[1-9][0-9]*$"
“^-?\d+$"
“^\d+(\.\d+)?$"
“^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"
“^((-\d+(\.\d+)?)|(0+(\.0+)?))$"
“^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$"
“^(-?\d+)(\.\d+)?$"
“^[A-Za-z]+$"
“^[A-Z]+$"
“^[a-z]+$"
“^[A-Za-z0-9]+$"
“^\w+$"
“^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"    //emailアドレス
“^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$" //url

Development

Posted by arkgame