Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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
Python 正则表达式模式/文本分析_Python_Regex_Nlp - Fatal编程技术网

Python 正则表达式模式/文本分析

Python 正则表达式模式/文本分析,python,regex,nlp,Python,Regex,Nlp,**编辑:我已经对它进行了更多的研究,我将为你们和我展示它: 具体的str,一堆我不知道的东西 方括号内的str是我需要找到的 那么我该如何展示里面的东西呢 我试过*和*?但都不起作用 import re print(re.findall(r'specific string.*\n\[(.*?)\]', 'specific string hello\n[test]')) 这将产生: ['test'] 嗯,这里是特定的字符串。*\n.\[(.*)]?

**编辑:我已经对它进行了更多的研究,我将为你们和我展示它:

具体的str,一堆我不知道的东西

方括号内的str是我需要找到的

那么我该如何展示里面的东西呢

我试过
*
*?
但都不起作用

import re
print(re.findall(r'specific string.*\n\[(.*?)\]', 'specific string hello\n[test]'))
这将产生:

['test']

嗯,
这里是特定的字符串。*\n.\[(.*)]