Ho to match exactly 6 or 8 or 10 figures numbers?
"787876" =~ /^\d{6}$/ -> TRUE
"78787633" =~ /^\d{8}$/ -> TRUE
"7878733226" =~ /^\d{10}$/ -> TRUE
"7878736" =~ /^\d{6}$/ -> FALSE
Ho to create one regexp for these cases.
Shorter form of:
"787876" =~ /^\d{6}$|^\d{8}$|^\d{10}$/
use this regex
^\d{6}(\d{2}){0,2}$