regex - Match digits in [g]awk -
i'm stumped! trying write awk regex match string against 11 digits.
i've tried:
if (var ~ /^[0-9]{11}$/ ) if (var ~ /^([0-9]){11}$/ ) if (var ~ /^([0-9]{11})$/ ) if (var ~ /^[0-9]{11}/ ) # altho need check whole str if (var ~ /[0-9]{11}/ )
if use this....
if (var ~ /^[0-9]+/ )
then match - need check 11 digits.
you described problem, didn't tell awk version. important information.
but may work case:
if (var ~ /^[0-9]+$/ && length(var)==11)
if know version, there simpler solution.
Comments
Post a Comment