Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

You need to be registered to interact with the community.
This question has been flagged
1 Reply
1897 Views

我有一个网址下的图片,希望使用cdn

请将此网址转成正则表达式


/[字母与数字组成的字符串]/static/description/[xxx图片]

在这里放置您的问题。
Avatar
Discard

要将此网址转换为正则表达式,您可以使用以下模板:

```
/字母与数字组成的字符串/static/description/xxx图片
```

其中,`字母与数字组成的字符串`表示任意由字母和数字组成的字符串。在正则表达式中,我们可以使用`\w+`来匹配这样的字符集合。

因此,完整的正则表达式如下所示:

```
/\w+/static/description/[a-zA-Z0-9_]+\.(jpg|png|gif)
```

其中,`[a-zA-Z0-9_]+`用于匹配图片文件名(不包括扩展名),`\.(jpg|png|gif)`用于匹配图片文件扩展名。

希望这能对你有所帮助!

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!