正则大神们求助,小弟在Java代码中获取到了一串数据,想要用正则表达式匹配所需要文字,还望大佬们施加援手

大神们我的代码如下:

 String fileName ="F:\\py1\\wxprint.txt";
        FileReader fileReader = new FileReader(fileName);
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        System.out.println("字符集:"+fileReader.getEncoding());
        String line =bufferedReader.readLine();
        while (line!=null) {
            System.out.println(line);
           // List lines = new ArrayList();
            System.out.println("==========");
            s.setThistime(theTime);
                                                                                            //compile("")实在不知道怎末填了
            Matcher matcher = Pattern.compile("").matcher(line);

//compile("") 里面写过: Pattern.compile("(?<=,'Text':')[\S]+?(?=',)").matcher(line);匹配不到
打印结果如下:
图片说明

要匹配的记事本中的部分内容如下:

图片说明

(注:记事本处显示的内容目前不是完全的json,不好解析,所以想用正则试试)
小弟想要匹配到如红框处所有'Text':后面的文字,还望正则大神们教教小弟,感激不尽。

图片说明
(此为按照qiangchen1990大佬教的结果,还望大佬再交一下)

部分文本如下:
{'StatusNotifyCode': 0, 'ActualNickName': '多多', 'MsgId': '4750673808156304087', 'Type': 'Text', 'AppMsgType': 0, 'FileSize': '', 'SubMsgType': 0, 'HasProductId': 0, 'ToUserName': '@@bff166403f4a632e8315351ca040ce77f413deee515ebe7c37aed744a1413b5e', 'ActualUserName': '@a595384fe0c1c6c3aea42fe54aef15c1', 'IsAt': False, 'AppInfo': {'Type': 0, 'AppID': ''}, 'EncryFileName': '', 'User': , 'PYQuanPin': ''}>, 'Sex': 0, 'MemberList': , 'PYQuanPin': ''}>, , 'PYQuanPin': ''}>]>, 'City': '', 'Signature': '', 'HeadImgUpdateFlag': 1, 'AttrStatus': 0}>, 'ForwardFlag': 0, 'ImgHeight': 0, 'Url': '', 'FromUserName': '@a595384fe0c1c6c3aea42fe54aef15c1', 'FileName': '', 'MsgType': 1, 'VoiceLength': 0, 'Content': '问问', 'RecommendInfo': {'OpCode': 0, 'Province': '', 'VerifyFlag': 0, 'NickName': '', 'AttrStatus': 0, 'Content': '', 'UserName': '', 'Alias': '', 'Sex': 0, 'Scene': 0, 'City': '', 'Signature': '', 'Ticket': '', 'QQNum': 0}, 'Status': 3, 'MediaId': '', 'Text': '问问', 'ImgStatus': 1, 'ImgWidth': 0, 'PlayLength': 0, 'CreateTime': 1566271903, 'NewMsgId': 4750673808156304087, 'Ticket': '', 'StatusNotifyUserName': '', 'OriContent': ''}

(?<=\'Text\':').+?(?=\')

示例代码:

 String pattern = "(?<=\\'Text\\':').+?(?=\\')";
        String text = "'Text':'qweqe'fwerqwer fqefqwer eer fqdse wqc'Text':'1231231'";
        Pattern pattern1 = Pattern.compile(pattern);
        Matcher matcher = pattern1.matcher(text);
        while (matcher.find()){
            System.out.println(matcher.group());
        }

输出:

qweqe
1231231
```![图片说明](https://img-ask.csdn.net/upload/201908/23/1566527101_445295.png)
Pattern.compile("(?<=\\,\\s\\'Text\\'\\:\\s\\')\\w+?(?=\\')").matcher(line);

逗号引号冒号都要转义,检查有没有空格,有的地方也加上

可以先在在线正则网站里测试好了,再写到你的程序里。

字符串截取就好了

String text="……";
String[] texts=text.split("\\'Text\\'\\:");
 texts=texts[1].split("\\'");
 String 目标=texts[0];

正则表达式的特殊符号不是需要转义的吗