Guest User

Untitled

a guest
Feb 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function validar() {
  2. usuario = document.getElementById('usuario').value;
  3.  
  4. patron = /d{3}/;
  5. if(patron.test(usuario)){
  6. alert("correcto")
  7. }else{
  8. alert("ERROR")
  9.  
  10. }
  11.  
  12. if (usuario > 99 && usuario < 1000) {
  13. //válido
  14. }
  15.  
  16. textoterminadoen1234
  17. // ^^^
  18. // coincide con estos 3
  19.  
  20. /^D*d{3}$/
  21.  
  22. /^(?:D*d){3}D*$/
Add Comment
Please, Sign In to add comment