Regular expression in AWK

Hello world,

I was wondering if there is a nicer way to write the following code (in AWK):

 
awk '
FNR==NR&&$1~/^m[24689]$/{tok1=1}
FNR==NR&&$1~/^m10$/{tok1=1}
' my_file

In fact, it looks for m2, m4, m6, m8 and m10 and then return a positive flag. The problem is how to define 10 thanks to regular expresions?
Is there a way do a list of possible values, like "{2,4,6,8,10}"?

Let me know,

Thanks

how 'bout;

awk '
FNR==NR { tok1=($1 ~ "^m([24689]|10)$" ? 1 : 0}
' my_file

Thanks, that is what I was looking for!

There's a missing close parenthesis after the last zero and NR==FNR is unnecessary if you have 1 input file, this should be sufficient:

awk '{tok1=/^m([24689]|10)$/?1:0}' file