Just figured out how to connect to Asterisk that required leading 0 to dial out (system in Belgium, so +32). Here are some examples that work for us:
Example 1 (Mobile numbers are of format 0475 123 456 or 0032495 123456)
Regex: ((0032)?(0)?(4[7|8|9]\d{7}))
Normalize: 0$1
Example 2 (Mobile numbers with +32)
Regex: (\+)(324[7|8|9]\d{7})
Normalize: 000$2
Example 3 (Belgium National Numbers)
Regex: \+?(32)?(0032)?(0)?(\d{8})
Normalize: 000$4
Maybe not the most elegant but they get the job done :).
As for the capture groups I found some conflicting information, this is my experience: they start at $1 (as opposed to some references I encountered in the PC docs; it also works that way in Javascript), which is also the outer group, anything contained within has a consecutive number, so $2, $3, etc.