http://www.perlmonks.org?node_id=43338


in reply to Using regexps to parse an XML DTD file

Not what I would do ($1 is not neccesarily a good thing ;-)), but here's some code that works, note that it's not all a regex :-)
$string = "<!ELEMENT ORDER (NAME,DELIVERY,PAYMENT,ORDERNUMBER)>"; $string =~ m/\((.*)\)/; @array = split (/,/,$1); foreach (@array){print "$_\n"}