我有这种脚本。我想选择/删除从<script type='text/javascript'>
到</script>
<script type='text/javascript'> window['__wavt'] = 'AOuZoY7C5YW0NbvyHBM2AbUwwOO7gpMxsA:1495265533940';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d1126651761205083490','11-povesti-in-11-minute-la-11even.html'/*tpa=http://www.sena.com/2012/05/11-povesti-in-11-minute-la-11even.html*/,'1126651761205083490');
_WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '1126651761205083490', 'title': 'Richie`s Day', 'url': 'my-link.html'/*tpa=http://www.sena.com/2012/05/mylink.html*/, 'canonicalUrl': </script>
无论如何,我制作了2个正则表达式,但都没有效果:
(<script type='text/javascript'>)[\s\S]*?(</script>[\s\S]*?
(?-s)^.*(<script type='text/javascript'>)(?s).*?(?-s)(</script>).*(\r\n|\z)
答案 0 :(得分:0)
当然,我找到了答案:
(?s)(<script type='text/javascript).*?(?-s)(</script>)
或
^.*(?s)(<script type='text/javascript).*?(?-s)(</script>).*$
所以,对任何人来说,
(?s)(SELECT_FROM-PART-ONE).*?(?-s)(TO-PART-TWO)
或
^.*(?s)(SELECT_FROM PART-ONE).*?(?-s)(TO_PART_TWO).*$