繁体   English   中英

如何使用 RegEx 在 URL 中的两个正斜杠之间提取字符串

[英]How to extract string between two forward slashes in URL using RegEx

我有一个如下所示的 URL 列表:

https://www.abcd.fr/location-villas/afrique/maroc/marrakech/palmeraie-et-environs/villa-abbbb

https://www.abcd.fr/location-villas/asie/thailande/koh-samui/mae-nam/villa-abcd

并且我想使用正则表达式提取国家名称,例如上述 URL 中的 maroc 和 thailande。

我有一个如下所示的 URL 列表:

https://www.abcd.fr/location-villas/afrique/maroc/marrakech/palmeraie-et-environs/villa-abbbb

https://www.abcd.fr/location-villas/asie/thailande/koh-samui/mae-nam/villa-abcd

并且我想使用正则表达式提取国家名称,例如上述 URL 中的 maroc 和 thailande。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM