请您参考如下方法:
让我在这里写下来自 superuser.com question 的答案由于我完全声援作者:
quote from the Ask Metafilter:
The only possible way to make keyword searching efficient over hundreds of terabytes (or whatever their index is up to these days) is to precompute an index of words.
In fact a full regex engine is turing-complete, and you can write arbitrary regexps that will gobble up near infinite amounts of CPU time and memory. For all these reasons it would be technical insanity for them to offer regex searching to the general public.
更新:正如它正确指出的那样,正则表达式不是图灵完备的。请继续关注更详细的答案:
待定...