[Solved] regular expression to check if string is valid XML [closed]

[ad_1]

It’s not possible to validate XML with regular expressions. XML is not a regular language.

Use an XML parser to try to parse the string as XML or else validate the XML document against a schema, for example a DTD or XSD file.

[ad_2]

solved regular expression to check if string is valid XML [closed]