in reply to Parsing ANSI color escape sequences

A regexp to parse color escape sequence could be:
m/\\033\[(\d+)(?:;(\d+)(?:;(\d+))?)?m/;
I tested three cases:
  1. \033[0m, gives me $1 = 0, $2 and $3 undefined. Correct;
  2. \033[1;31m, gives me $1 = 1, $2 = 31, and $3 undefined. Correct;
  3. \033[1;31;44m, gives me $1 = 1, $2 = 31, and $3 = 44. Correct.