Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?i)<!DOCTYPE[^<>]*(?:<!ENTITY[^<>]*>[^<>]*)?>
/
g
Input 1
1
New
<!DOCTYPE ichicsr SYSTEM "http://www.w3.org/TR/html4/frameset.dtd"> <!DOCTYPE ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM "D:\UPGRADE\NTServices\Server\\latin-entities.dtd"> %entitydoc;]> But if i've the doctype as given below, it doesn't work and the root tag in the xml get stripped off - <!DOCTYPE ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM 'D:\UPGRADE\NTServices\Server\\Xml21.dtd'> ]> <!Doctype ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM 'D:\UPGRADE\NTServices\Server\\Xml21.dtd'> ]>
Substitution
<!DOCTYPE ichicsr SYSTEM "http://www.w3.org/TR/html4/frameset.dtd"> <!DOCTYPE ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM "D:\UPGRADE\NTServices\Server\\latin-entities.dtd"> %entitydoc;]> But if i've the doctype as given below, it doesn't work and the root tag in the xml get stripped off - <!DOCTYPE ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM 'D:\UPGRADE\NTServices\Server\\Xml21.dtd'> ]> <!Doctype ichicsr SYSTEM "D:\UPGRADE\NTServices\Server\\Xml21.dtd" [<!ENTITY % entitydoc SYSTEM 'D:\UPGRADE\NTServices\Server\\Xml21.dtd'> ]>