Contrary to my interpretation of the requirements of the OP, both your regex and the updated regex of rovf's OP allow a 'Z' between the first 'A' and the final 'Z', and also still need to have an undefined $1 rationalized to an empty string.
In reply to Re^2: This regexp made simpler
by AnomalousMonk
in thread This regexp made simpler
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |