Match a string against multiple regex patterns

前端 未结 6 1361
甜味超标
甜味超标 2020-12-29 04:46

I have an input string.

I am thinking how to match this string against more than one regular expression effectively.

Example Input: ABCD
6条回答
  •  爱一瞬间的悲伤
    2020-12-29 05:34

    like it was explained in (Running multiple regex patterns on String) it is better to concatenate each regex to one large regex and than run the matcher only one. This is an large improvement is you often reuse the regex.

提交回复
热议问题