High performance simple Java regular expressions

前端 未结 4 532
北海茫月
北海茫月 2021-02-08 03:44

Part of the code I\'m working on uses a bunch of regular expressions to search for some simple string patterns (e.g., patterns like \"foo[0-9]{3,4} bar\"). Currently, we use sta

4条回答
  •  日久生厌
    2021-02-08 04:40

    Try matcher.reset("newinputtext") method to avoid creating new matchers each time you are calling Pattern.matcher.

提交回复
热议问题