I want to write a program.

in the program i need to generate a password that contain 8 - 10 charachters.
i did it, but without regex, Can any one help me, how to do this with the regular exp ?

the criterias for the pass are:
1- the length 8 -10 chars.
2- the pass must contain just [a-z] or [A-Z] or [0-9].
3- i must use the char just once in the all pass

sorry for myweak eng
I hope that u understand me, and i hope that u help me.

thank u :)

TiTo ^_^

A regex is typically for checking/replacing a string, not creating one.

Yes, exactly

I write the code.

<title>password generaton</title>


function randomPassword()
	var repeats = /(.)\1/;
	var length = randomFromTo(8,12);
	chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
	pass = "";
		i = Math.floor(Math.random() * 62);
		pass += chars.charAt(i);
	return pass;

function formSubmit()
  passform.passbox.value = randomPassword();
  return false;

function randomFromTo(from, to){
       return Math.floor(Math.random() * (to - from + 1) + from);

//  End -->

<table align="center" border="1">
<td valign="middle" align="center">
<center>Random Password Generator</center>
<form name="passform">

Password: <input name="passbox" type="text" size="50" tabindex="1"></p>
<input type="button" value="Generate" onClick="javascript:formSubmit()" tabindex="2"> <input type="reset" value="Clear" tabindex="3"></p>

but it doesn't work, it's check if the are two cahrs repeating, i.g if the pass is hello, so can to match it.

but i want to check all the pass not only every two chars
i.g: welcome, i want to match it because it's contains the lchar "e" more than once.