简体   繁体   中英

Replace XML initial tag with regex in JS

I want to get all the strings starting with <?XML and ending with ?> to replace in Javascript strings.

For example <?XML version="1.0" encoding="UTF-8"?> should be replaced with ''

because parsing it is resulting in an error.

regex that starts with <?XML and ends with ?> should be given as

<\?\s*XML.*\?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM