PHP Regular Expression
===

this is litteraly driving me nuts!

What I want to achieve:

part 1: pseudo must start with [a-zA-Z0-9] then it can or not have ONE [._-] or ONE space

part 2: it must finish with [a-zA-Z0-9]

The part 1 can repeat forever but it must finish with part 2.

It tried like a million ways of doing it and it never works. With the code that I have below if I put "Test__test" (with TWO "\_") it works when it shouldn't. Please help

    <!doctype html>
<html>
	<head>

	</head>
	<body>
		<form method="POST" action="">
			<input type="text" name="pseudo"/><br /><br />
			<input type="submit" name="submit" value="Valider"/>
		</form>
		
		<?php
			if(isset($_POST['pseudo']))
			{
				$pseudo = $_POST['pseudo'];
				
				if(preg_match('/([a-zA-Z0-9]{1,}[._-]{0,1})+[a-zA-Z0-9]{1,}$/',$pseudo))
				{
					echo "Ok";
				}else
				{
					echo "Error";
				}
			}		
		?>

	</body>
</html>