The ? character means to match zero or one instance of the previous pattern element; the * character means to match zero or more of the previous element.
字符表示匹配前面模式元素的零个或一个实例,* 字符表示匹配前面元素的零个或多个实例。
This expression is then retained by the Pattern class before it is passed on to the Matcher class to check for matches in the context of a character sequence.
Pattern 先保存要使用的表达式,然后将其传递给 Matcher 类以便在字符序列的上下文中检查其匹配情况。
You may include a "default" case at the end of a pattern match, either using the underscore wild card character or a meaningfully-named variable.
你可以在模式匹配的最后包含一个“default”默认case,可以使用下划线通配符,或者有含义的变量名。
应用推荐