Is there a solution to create any removing operation? I have got a vector with strings and I must remove each element on the texts, so I create a regular expression with "or" and case-insensitive search ans use regex_replace to remove the words
If you care about performance, write your own matching routine. I'd build a tree/forest of chars from your matching words, one pointer goes through original string, N pointers may follow the matching tree, the original text gets copied char by char (one pass), the matching pointers runs on tree/forest, if one of the matching pointers goes through, you have the match and move the writing output pointer back. The details like longest match or encoding support are up to you how to handle. Should be much faster than general regexp. -- Slava