将单元格中的文本仅限于找到的倒数第二个栏
Limit text in a cell only to the penultimate bar found
链接由不同数量的条组成,但我对最后一个条和倒数第二个条之间包含的内容不感兴趣,我可以使用什么公式?
原文:
https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/r54505/
https://int.soccerway.com/national/england/championship/20192020/regular-season/r53782/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/r56520/
https://int.soccerway.com/national/germany/play-offs-12/20192020/s17666/
https://int.soccerway.com/national/germany/play-offs-23/20192020/s17670/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/r56858/
https://int.soccerway.com/national/sweden/superettan/2020/s18293/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/r58293/
预期结果:
https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/
https://int.soccerway.com/national/england/championship/20192020/regular-season/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/
https://int.soccerway.com/national/germany/play-offs-12/20192020/
https://int.soccerway.com/national/germany/play-offs-23/20192020/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/
https://int.soccerway.com/national/sweden/superettan/2020/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/
测试失败:
REGEXEXTRACT('Página1'!T2:T,
REGEXREPLACE('Página1'!T2:T,"(https?:\/\/([\w.-]+\/){6})","()"))
我测试的模型不工作,因为倒数第二个柱子并不总是在位置 6,所以它不适合我的需要。
尝试:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(REGEXEXTRACT(A1:A, "(.+)/"), "(.+)/")))
您可以匹配最后一个文本和 /
并捕获第 1 组之前的所有内容。
在替换使用组1中
例如单个条目=REGEXREPLACE(A1, "(https?://\S+/)[^\s/]+/", "")
(https?://\S+/)[^\s/]+/
链接由不同数量的条组成,但我对最后一个条和倒数第二个条之间包含的内容不感兴趣,我可以使用什么公式?
原文:
https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/r54505/
https://int.soccerway.com/national/england/championship/20192020/regular-season/r53782/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/r56520/
https://int.soccerway.com/national/germany/play-offs-12/20192020/s17666/
https://int.soccerway.com/national/germany/play-offs-23/20192020/s17670/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/r56858/
https://int.soccerway.com/national/sweden/superettan/2020/s18293/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/r58293/
预期结果:
https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/
https://int.soccerway.com/national/england/championship/20192020/regular-season/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/
https://int.soccerway.com/national/germany/play-offs-12/20192020/
https://int.soccerway.com/national/germany/play-offs-23/20192020/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/
https://int.soccerway.com/national/sweden/superettan/2020/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/
测试失败:
REGEXEXTRACT('Página1'!T2:T,
REGEXREPLACE('Página1'!T2:T,"(https?:\/\/([\w.-]+\/){6})","()"))
我测试的模型不工作,因为倒数第二个柱子并不总是在位置 6,所以它不适合我的需要。
尝试:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(REGEXEXTRACT(A1:A, "(.+)/"), "(.+)/")))
您可以匹配最后一个文本和 /
并捕获第 1 组之前的所有内容。
在替换使用组1中
例如单个条目=REGEXREPLACE(A1, "(https?://\S+/)[^\s/]+/", "")
(https?://\S+/)[^\s/]+/