You can submit URLs that contain regular expressions in a purge task. Alibaba Cloud and DCDN then purge all URLs that match the specified regular expression, enabling you to purge content with greater precision.
Usage notes
When you set the operation method to regular expression, you can submit URLs that contain regular expressions to purge all matching URLs in bulk. The following rules apply:
-
You can specify URLs that contain only the following four regular expressions in the URL field. Do not enter any regular expressions other than these four patterns:
-
[0-9]: Matches any single digit (0-9). Example:img[0-9].jpgmatchesimg0.jpgthroughimg9.jpg. Useful for purging resources by version number or index. -
[a-z]: Matches any single lowercase letter (a-z). Example:file[a-z].txtmatchesfilea.txtthroughfilez.txt. Useful for purging resources by letter identifier. -
[^/]*: Matches a single path segment (any character sequence that does not contain/). Example:cdn.aliyun.com/[^/]*.jsmatches all JS files in the root directory, such ascdn.aliyun.com/main.jsandcdn.aliyun.com/app.js. Useful for purging resources of a specific file type within a directory. -
.*: Matches any path segment (any character sequence including/). Example:cdn.aliyun.com/.*matches all resources under the domain. Useful for full purge scenarios.
You can combine these patterns. For example:
http://www.example.com/[0-9][a-z].*.jpg -
-
Enter one rule per line. For example:
http://www.example.com/[0-9][a-z].*.jpg -
By default, each account is limited to 20 purge by regular expression tasks per day. If the peak daily bandwidth of your Alibaba Cloud account exceeds 10 Gbps, you can submit a ticket to request a higher daily quota.
-
URL purge, directory purge, and purge by regular expression all support cache sharing. If cache sharing is enabled for a domain name, you can purge the cache by submitting the task using either the primary or any associated domain name.
-
Before submitting a purge task, URL-encode any URLs with non-ASCII characters (such as spaces, Chinese characters, or special characters). The system cannot recognize tasks with unencoded URLs.
Procedure
-
Log on to the DCDN console.
-
Click .
-
On the Purge Cache tab, set Operation Method to Regular Expression.

-
Configure the rules and click Submit.