Some common restrictions are: Leaving the last requirement for now, as it requires a server-side script, let's see what's possible using just client-side HTML and Java Script.
The simplest way to do this is to have the password entered twice, and then check that they are identical.
They can be used not just in Java Script, but also PHP, Perl, Java and many other languages.
Some text editors (not just vi) also allow them when searching for or replacing text. This is a new technique available in modern browsers and definitely the way of the future.
A lot of websites now require registration, meaning that users need to be assigned a username and password.
Here are some simple steps to make the process more secure.