我有一个生成的字符串,像这样
tesgddedd
我想获取包含img的div,并在这个div中添加css类,得到一个新的字符串,像这样
tesgddedd
我尝试了这个方法
let myString = 'tesgddedd
' console.log('My new String with div class : ',myString.match(/]*img="[^"]*"[^>]*>/gm)[0])它不起作用。
请问我该怎么做?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号