Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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/8/file/3.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
Regex 正则表达式提取第一个文件名_Regex_File_Url_Expression_Extract - Fatal编程技术网

Regex 正则表达式提取第一个文件名

Regex 正则表达式提取第一个文件名,regex,file,url,expression,extract,Regex,File,Url,Expression,Extract,我想从此url提取第一个文件名: 无休止的诅咒--CE_v1.0.zip [URL=Curse-cev1.0.zip-10.4mb[/URL] (.*\/)([^\/]*)(\].*\[.*\]) 第二组将是您的文件名: 这与您的文件名相匹配,因为Regex中的组2不是一种编程语言。您是否考虑了一种特定的语言?每种语言都支持不同的正则表达式语法。我刚刚尝试过,它在记事本++中工作,用/2搜索并替换(.*\/)([^\/]*)(].[*]),这将给你的文件名,你提供的链接是非常好的!很好的资源,

我想从此url提取第一个文件名: 无休止的诅咒--CE_v1.0.zip

[URL=Curse-cev1.0.zip-10.4mb[/URL]

(.*\/)([^\/]*)(\].*\[.*\])
第二组将是您的文件名:


这与您的文件名相匹配,因为

Regex中的组2不是一种编程语言。您是否考虑了一种特定的语言?每种语言都支持不同的正则表达式语法。我刚刚尝试过,它在记事本++中工作,用/2搜索并替换(.*\/)([^\/]*)(].[*]),这将给你的文件名,你提供的链接是非常好的!很好的资源,谢谢
(.*\/)([^/]*)\](.*\[\/URL\])