perl -lne 'print $1 if(/[^D]*(D.*A).*/)'
X-X-D-X-X-A X-D-X-A-X D-X-X-X-X-A-X-X
D-X-X-A D-X-A D-X-X-X-X-A
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!