I'm using regex in C where I'm checking a word against a list of regex, below is what I have,
I have this string
0118889994444
and I have these regexes
^012[0-9]{10}$ if this one hits then do 1
^0011[0-9]{10}$ if this one hits then do 2
^00[0-9]{10}$ if if this one hits then do 3
^11[0-9]{10}$ if this one hits then do 4
^011[0-9]{10}$ if this one hits then do 5 // this one will match the string
What I'm currently doing is looping through the regex list and see which one will hit and then do whatever is set for that regex, so, the bigger the list the more time it takes to finish the loop, is there a way or a trick to make this faster and more intelligent :) ?