in reply to Tidying and simplifying a regular expression

I'm not aware of a Regex::Tidy , but I have an inspiration how to go

  1. use re 'debug' to decompile the regex
  2. parse op codes into tree structure
  3. apply rewrite rules for simplification
  4. rebuild standardized regex from tree

in your case you'd need rules to eliminate idempotence

Edit: for point 1 compare Parsing and translating Perl Regexes

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery