andmalv

[Tip] Validar Nombre y Apellido (Nombre Apellido)

Nov 12th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. while [[ ! "$name" =~ ^([A-Z,a-z]+ [A-Z,a-z]+)$ ]]; do
  2.         tput sc
  3.         read -ep " Nombre y apellido (Nombre Apellido): " name
  4.         tput rc
  5.         tput ed
  6. done
  7.  
  8. # Donde
  9. #       ^([A-Z,a-z]+ [A-Z,a-z]+)$ → 2 strings compuesto por letras
Advertisement
Add Comment
Please, Sign In to add comment