IIRF is rule-based, not procedural.
You need to write rules, that tell IIRF what to do when the incoming URL matches.
You said your regex is rusty, but that's not the main point. Regex is just a way to describe the patterns to match against the incomng URL.
The larger issue is the idea behind rules-based logic, versus procedural logic.
Think about the main things you want to happen to a URL. Let's start with downcasing as an example. I presume you want downcasing to happen with a REDIRECT. (If you don't clearly understand the difference between a REDIRECT and a REWRITE,
the documentation I wrote, now. It usually makes no sense to downcase with a rewrite, but not always. If you don't understand why, read the doc.)
Ok, you want to downcase. The simple rule for that is
RedirectRule ^/(.*[A-Z]+.*)$ /#L$1#E
Look at the replacement string. That's the /#L$1#E . What this does is, replace the first capture ($1) with itself, but wrapped in a down-cased bracket. ok, so that replaces A with a, and so on.
The pattern - that's the part that looks like cartoon swearing. It includes a single capture group, denoted by parens. Within the parens, .* says "zero or more of any character", because dot is a wildcard and * is a quantifer meaning "zero
or more". The [A-Z] says "any character from A-Z." The + following that is a quantifier meaning "one or more". Therefore [A-Z]+ says "one or more of any character from A-Z". Finally, another .*, which says "zero or more
of any character". Taken together this matches any string that has one or more uppercase characters in it.
The redirect rule is applied only to those URLs. It redirects to the same URL, but convverted to lower-case. Presumably the browser will send in the lowercased URL, after it gets the HTTP 302 response. The new URL will not have any characters
A-Z in it, because they've been converted to a-z. Therefore the rule will not match, for this second request. It will be handled by whatever handles URLs in your server.
If you have other conditions that you'd like to use before downcasing, then work them into that rule. For example, if you want to downcase only URLs that start with S, then include S as the first character in the capture group. And so on.
Ok, that takes care of downcasing. Then you have other requirements, apply those the same way. Create the rule, figure out the regex you need, create the replacement string.
Combine the rules into a set, and you're done.