Force Close on Regular Expression !match

前端 未结 3 543
借酒劲吻你
借酒劲吻你 2021-01-05 15:15

I am having a problem with the following bit of code. I am trying to match a string. When I have a match everything works perfectly. When it does not find a match it thro

3条回答
  •  -上瘾入骨i
    2021-01-05 15:35

    Try checking for a match instead:

    if (m.matches()){
    

    instead of:

    if (m.group(0) != ""){
    

提交回复
热议问题