I want to write a script to detect suffixes, words, and sections of written language. It will include a lot of string matching, so I want to write it based on regular expressions.
But I have a question about performance. For example, let's say we have 100+ different regular expressions and we want to match all of them simultaneously for an input text. How would that affect performance?
We have two options as I know, making an array of regular expressions and running them respectively with a loop. Another one is combining all the expressions with "|" and getting a huge regular expression string. Which one would be better by means of performance?
If none of these are logical, can you please suggest me another method to achieve that?