diff --git a/zap b/zap index 098e60c..e0571df 100755 --- a/zap +++ b/zap @@ -570,10 +570,27 @@ fi # portability of {} in egrep is uncertain dsptn='^\w[[:alnum:]_.:-]*(/[[:alnum:]_\.:-]+)*$' hostptn='^((\w|\w[[:alnum:]-]*\w)\.)*(\w|\w[[:alnum:]-]*\w)$' -# https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses -ipv4ptn='^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$' -ipv6ptn='^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$' -ipv4llptn='^127\.((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){2,2}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$' +# goo.gl/t3meuX (Stackoverflow answer about IP regexp) +ipv4ptn="^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|\ +1{0,1}[0-9]){0,1}[0-9])$" +ipv6ptn="^([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|\ +([0-9a-fA-F]{1,4}:){1,7}:|\ +([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|\ +([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|\ +([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|\ +([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|\ +([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|\ +[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|\ +:((:[0-9a-fA-F]{1,4}){1,7}|:)|\ +[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|\ +::([fF]{4}(:0{1,4}){0,1}:){0,1}\ +((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}\ +(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|\ +([0-9a-fA-F]{1,4}:){1,4}:\ +((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}\ +(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$" +iplbptn="^(127\.((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){2,2}\ +(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^::1$" ttlptn='^[0-9]{1,4}[dwmy]$' unptn='^[[:alnum:]_][[:alnum:]_-]{0,31}$' zptn="@ZAP_(${hn})_..*--[0-9]{1,4}[dwmy]"