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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -