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.
字符表示匹配前面模式元素的零个或一个实例,* 字符表示匹配前面元素的零个或多个实例。
2
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.
This function is not smart enough to identify the character values in the final example of use and thus be able to warn the user. You could use a string pattern matching test such as.