I know you requested a regex, but what happened to this in Groovy?
Assuming the xml looks something like this:
def xml= '''<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE abc-config>
<abc-config version="THIS" id="abc">
<node></node>
</abc-config>'''
Then I can analyze it with:
def n = new XmlSlurper().parseText( xml )
And then this line:
println n.@version
"THIS"
DOCTYPE, DOCTYPE:
def parser = new XmlSlurper()
parser.setFeature( "http://apache.org/xml/features/nonvalidating/load-external-dtd", false )
parser.setFeature( "http://xml.org/sax/features/namespaces", false )
parser.parseText( xml )
XmlSlurper, 2 ,