Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在java中使用正则表达式从网格中获取值_Java_Regex - Fatal编程技术网

如何在java中使用正则表达式从网格中获取值

如何在java中使用正则表达式从网格中获取值,java,regex,Java,Regex,我正在开发简历解析器,我可以从文本中获取一些数据,例如公司的详细信息,但如果这些数据保存在网格或表格中,则无法获取 import java.io.FileNotFoundException; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.JOptionPane; import org.apache.poi.xwpf.ext

我正在开发简历解析器,我可以从文本中获取一些数据,例如公司的详细信息,但如果这些数据保存在网格或表格中,则无法获取

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class CmpnyNameex {
    public static void main(String[] args)throws IOException {
        String text="";
        String name="";
            XWPFDocument msDocx = new  XWPFDocument(new FileInputStream("A:\\Resumes\\Anwesh.docx")); 
            XWPFWordExtractor extractor = new XWPFWordExtractor(msDocx);
            text = extractor.getText();      
        }
        catch(FileNotFoundException ex){ex.printStackTrace();
            JOptionPane.showMessageDialog(null,"The system cannot find the      file specified file it may be because of old file    format","Error",JOptionPane.ERROR_MESSAGE);
        }
        String rx13="(?<=Have been associated with).*.(.*Ltd?)";                
        Pattern p1 = Pattern.compile(rx13);
        Matcher found1 = p1.matcher(text);          
        while(found1.find())
        {
            name= found1.group(0);
        }       
    }
}
import java.io.FileNotFoundException;
导入java.io.IOException;
导入java.util.regex.Matcher;
导入java.util.regex.Pattern;
导入javax.swing.JOptionPane;
导入org.apache.poi.xwpf.extractor.XWPFWordExtractor;
导入org.apache.poi.xwpf.usermodel.XWPFDocument;
公共类CMPNYNAMEX{
公共静态void main(字符串[]args)引发IOException{
字符串文本=”;
字符串名称=”;
XWPFDocument msDocx=新的XWPFDocument(新文件输入流(“A:\\Resumes\\Anwesh.docx”);
XWPFWordExtractor extractor=新的XWPFWordExtractor(msDocx);
text=提取器.getText();
}
catch(FileNotFoundException ex){ex.printStackTrace();
showMessageDialog(null,“系统找不到指定的文件,可能是因为旧文件格式”,“错误”,JOptionPane.Error\u消息);
}

String rx13=“(?那么您想要捕获什么值?您能给我们展示一个简单的输入输出吗?