funzionava anche nell'altro caso
ma ho modificato la regexp sostituendo \. con [.] perchč non avevo conteplato che potevano esserci anche + ripetizioni per posizione
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<script language="javascript" type="text/javascript">
	function controllo_avs()
	{ 
		with(document.inviadati) 
		{ 
		   var regTest = /[\d]{3}[.][\d]{2}[.][\d]{3}[.][\d]{3}/;
		
		   if (!regTest.test(NumAVS.value))
		   {
			   alert("Campo AVS non valido: il formato per l'inserimento dati č XXX.XX.XXX.XXX (es. 123.12.123.123)");
			   NumAVS.focus(); 
			   return false;
		   } 
		   
	   alert("Dati personali inseriti con successo."); 
	   return true; 
		}
	}
	</script>
	</head>
	<body>
	<form name="inviadati"  onsubmit="return controllo_avs();" method="post"> 
	<table align ="center">
		<tr>
			<td>N°AVS*</td>
			<td><input name="NumAVS" type="text" maxLength="50"></td>
		</tr>
		<tr>
			<input type="submit" name="action">	
		</tr>
	</table>
	</form>
	</body>
</html>