Java Regex group 0

后端 未结 2 1869
一生所求
一生所求 2020-12-09 13:53

Can someone please help me to explain the following code? Thanks. I am a little bit confused about the regex grouping.

public static String evaluate(String s         


        
2条回答
  •  春和景丽
    2020-12-09 13:58

    From the documentation:

    Group zero denotes the entire pattern, so the expression m.group(0) is equivalent to m.group().

    In other words, mr.group(0) is the entire match.

提交回复
热议问题