泽西岛
String regex = String.format("^%s(\$.+)?", entryNameToMatchWithRegex);
页: 1
我正在取得意想不到的结果,在伐木时,它像这样印刷了:
The regex for entry BLOCK_LEAK_22, is: ^BLOCK_LEAK_22($.+)?
为此,它应当努力:^>。 BLOCK_LEAK_22(/$.+)?
www.un.org/Depts/DGACM/index_spanish.htm 我的理解是,该日志正显示该日形形形形形形形形色色()的缩略语,表明该浮标有选择性,因此我需要它,因为例如,在核对有这种名字的日志时(测试组):
String[] testStrings = {
"BLOCK_LEAK_22$55",
"BLOCK_LEAK_22",
"BLOCK_LEAK_22$1"};
for (String str : testStrings) {
System.out.println(str + " -> " + str.matches("^BLOCK_LEAK_22(\$.+)?"));
}
它应当印刷:
BLOCK_LEAK_22$55 -> true
BLOCK_LEAK_22 -> true
BLOCK_LEAK_22$1 -> true
But since the regex is being like this: ^BLOCK_LEAK_22($.+)?
then im getting this results (wrong):
BLOCK_LEAK_22$55 -> true
BLOCK_LEAK_22 -> false
BLOCK_LEAK_22$1 -> true