My pattern is OR-like : "word1|word2|word3" I have approximately 800 words.
Can it be a problem ?
You're only limited by memory and sanity. :)
You might consider using the Aho–Corasick string searching algorithm. It would be much more efficient than a regex, since it's linear and optimized for your problem. It's also a way to pay respect to our fellows from 1975 !
In particular, there is this Java implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With