morpe

regExp per http e .com

Feb 10th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function ricRez(){
  2. var str1 = document.f1.testo1.value;
  3.  
  4. //^vuota - ^ - trova la parola "vuota" all inizio, utile per trovare http://
  5. //vuota$ - $ - trova la parola "vuota" alla fine, utile per trovare .com o un punto di un dominio
  6. var ricor = /vuota$/;
  7. str1a = ricor.test(str1);
  8. document.f1.testo2.value = str1a;
  9. document.f1.p1.value = "haaaaa fa maleeee!!!";
  10. document.getElementById("mostra").innerHTML = "<h1>Bastardo!!</h1>";
  11. }
Add Comment
Please, Sign In to add comment