My pattern is OR-like : "word1|word2|word3" I have approxima开发者_运维知识库tely 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.
Why should it be? No, probably not.
A regexp with 800 words indicates a design problem somewhere, I would say. Why and what for do you need 800 words?
精彩评论