求一个验证引号的正则表达式!!!在线等!!! 请教高手验证引号是否存在这个'D:\重要东西\Model_Shanxi_20090325\[3-1_Allocation_Capex&Opex-LNE.xls]3-1.4_LNE Unit Cost'!E25字符串里请高手赐教啊在线等啊!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 仅仅验证是否有单引号:reg="[']";content = "This is a te'st";Pattern tagPattern = Pattern.compile(reg);Matcher m = tagPattern.matcher(content);if(m.find()){ System.out.println("yes");} if (str.indexOf("'")>-1) System.out.println("yes"); import java.util.regex.Matcher;import java.util.regex.Pattern;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String reg="[']"; String content = "This is a te'st"; Pattern tagPattern = Pattern.compile(reg); Matcher m = tagPattern.matcher(content); if(m.find()){ System.out.println("yes"); } }} package test;public class Test_Char { public static void main(String args[]){ int y=0; String str="'D:\\重要东西\\Model_Shanxi_20090325\\[3-1_Allocation_Capex&Opex-LNE.xls]3-1.4_LNE Unit Cost'!E25"; for(int i=0;i<str.length();i++){ if(str.charAt(i)=='\''){ y++; System.out.print(str.charAt(i)); } } if(y>=0){ System.out.println("有"+y);} }} 加上:int count = 0; while(m.find()){ count++; } if(count >= 2){ System.out.println("yes"); } else { System.out.println("no"); } java.io.FileNotFoundException: test/fileThread-494 (Too many open files) 关于用java6.0的方法编译java程序的问题 java 点对点 java如何生成高质量缩略图 Swing程序使用越来越多的内存,有什么好招? 生成jar的问题 组件化分页 索引业务逻辑分析 事件处理问题,希望高手指点一下 请帮我看看这个程序有什么问题,我实在不知道错在哪? 大家帮帮忙!HELP!HELP! 关于java编程思想 请一个实例
reg="[']";
content = "This is a te'st";
Pattern tagPattern = Pattern.compile(reg);
Matcher m = tagPattern.matcher(content);
if(m.find()){
System.out.println("yes");
}
if (str.indexOf("'")>-1)
System.out.println("yes");
import java.util.regex.Pattern;public class Test { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String reg="[']";
String content = "This is a te'st";
Pattern tagPattern = Pattern.compile(reg);
Matcher m = tagPattern.matcher(content);
if(m.find()){
System.out.println("yes");
}
}}
public static void main(String args[]){
int y=0;
String str="'D:\\重要东西\\Model_Shanxi_20090325\\[3-1_Allocation_Capex&Opex-LNE.xls]3-1.4_LNE Unit Cost'!E25";
for(int i=0;i<str.length();i++){
if(str.charAt(i)=='\''){
y++;
System.out.print(str.charAt(i));
}
}
if(y>=0){
System.out.println("有"+y);}
}
}
int count = 0;
while(m.find()){
count++;
}
if(count >= 2){
System.out.println("yes");
} else {
System.out.println("no");
}