add regexp -e option
replace strtok calls with strtok_r
since we are in a multithread env