in reply to Why machine-generated solutions will never cease to amaze me
/foo|(bar)?|rat/ is not logically equivalent to /(foo|bar|rat)?/. They both match every possible string, but they will put different things in $1 and $&.