regex match a file in an URL for Redirection WP plugin

In the Wordpress Redirection plugin, I'm trying to match page hits for

/wp-content/blogs.dir/2/files/themer/folder-uploads/*.htm

to simply redirect to a 404.

what's the regex equivalent of the simple * wildcard?
LVL 2
SonicVoomAsked:
Who is Participating?
 
Terry WoodsConnect With a Mentor IT GuruCommented:
If you want to exclude sub-folders of /wp-content/blogs.dir/2/files/themer/folder-uploads/
then instead of using .* a better wildcard would be [^/]* like this:
/wp-content/blogs.dir/2/files/themer/folder-uploads/[^/]*\.htm

The syntax works like this:
[abc] means match exactly one character, either a or b or c
[^abc] means match exactly one character that's not a or b or c
the * after it means match any number of the previous character, including zero
+ is like *, except it means match one or more of the previous character
0
 
Terry WoodsIT GuruCommented:
Use .* to match any number of any character, including zero.
If you want to match an actual . character, use \. or [.]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.