$_ = 'alpha="first" beta="second" gamma="third"'; while (/(\w+)=("[^"]*"|\w+)/g) { print("$1: $2\n"); }