String str="e:\\data\\";
if (str.matches(".+\\$"))
System.out.print("yes");
else
System.out.print("no");我想检查字符串是否以‘\’结尾
该正则表达式 在perl下正常
在java下为什么不对
总打印no
if (str.matches(".+\\$"))
System.out.print("yes");
else
System.out.print("no");我想检查字符串是否以‘\’结尾
该正则表达式 在perl下正常
在java下为什么不对
总打印no
if (str.endsWith("\\"))
System.out.print("yes");
else
System.out.print("no");
}
if (str.matches(".+\\\\$"))
System.out.print("yes");
else
System.out.print("no");