First of all, the \0, \a etc sequences (when used in the <sub> parameter) are handled by mirc itself, not PCRE. Before explaining what each sequence is, let's first consider $regml(). $regml(N) returns the Nth captured substring, taking into account all /g iterations. To see what I mean, consider $regex(ab@c@d,/([a-z])|@/g)

The pattern matches a lowercase letter or a '@'. If it's a letter, it is captured, otherwise it's not. So in this case,
$regml(1) = a
$regml(2) = b
$regml(3) = c
$regml(4) = d
and
$regml(0) = 4

So the number of captured substrings in total is $regml(0) = 4.

Now most of the special sequences can be explained in terms of $regml():
  • \n is the number of the Nth iteration when /g is used (to see what it is exactly, type //echo -ag $regsubex(ab@c@d,/([a-z])|@/g,<\n>) - if no /g is used, \n is always 1)
  • \0 is the same as $regml(0)
  • \t is the same as $regml(\n) (note that you can use $regml() directly inside the <sub> parameter in $regsub/$regsubex)
  • \a is a space-separated list of all $regml(N) items, ie all the captured substrings. A piece of code that would replicate \a would be:
    Code:
    var %i = $regml(0), %a
    while %i {
      %a = $regml(%i) %a
      dec %i
    }
    ; %a is the same as \a now
  • \A is the same as \a except there are no spaces between the captures. The same piece of code as above would generate \A if you changed the 2nd line to %a = $regml(%i) $+ %a
  • \1, \2, \3 etc cannot be expressed in terms of $regml(); \1 returns the captured substring of the first () pair in the pattern, \2 the capture of the second () pair and so on. However, it may be that a ()-enclosed subpattern doesn't always match (eg when it's an alternative subpattern). The example mentioned before is exactly such a case:
    $regsubex(ab@c@d,/([a-z])|@/g,<\1>)
    In the first /g iteration, ([a-z]) matches "a", so \1 would be "a".
    In the second /g iteration, ([a-z]) matches "b", so \1 would be "b".
    In the third /g iteration, ([a-z]) doesn't match "@" but @ does. Here \1 takes the value of the next successful \1 (in this case "c"). A similar thing happens if \2 is used and there's only one () pair in the pattern; \2 takes the value of the next \1.