How to set a time limit on a java function running a regex

后端 未结 10 907
难免孤独
难免孤独 2020-12-17 02:41

I am running a regex in a java function to parse a document and return true if it has found the string specified by the regex and return false if it hasn\'t. But the problem

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 03:17

    I agree to check the regular expressions before they are used. If you need a safety net, you might use something like this...

    http://gist.github.com/630969

提交回复
热议问题