Last active
June 6, 2018 07:07
-
-
Save hwindo/a4eb68d86157dd93301bd0e4aa9a77d8 to your computer and use it in GitHub Desktop.
simple js function to check if a string is XML using Regular Expression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkStringIsXML(data) { | |
var matcher = new RegExp('<?xml'); | |
return data.match(matcher) ? true : false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment