正则表达式:
/<a href="(.*) target/gim
测试字符串:
<a href="/rss/images/" target="_blank"><img src="/themes/blooper/footer_rss.png" alt="RSS" title="RSS"></a>,<a href="https://t.me/blooper" target="_blank"><img src="/themes/blooper/footer_telegram.png?t=1" alt="Telegram" title="Telegram"></a>,<a href="https://discord.gg/lit" target="_blank"><img src="/themes/blooper/footer_discord.png?t=1" alt="Discord" title="Discord"></a>,<a href="http://blooper.media/"><img src="/themes/blooper/blooper.png" alt="blooper.media" title="blooper.media"></a>
结果:
<a href="/rss/images/" target="_blank"><img src="/themes/blooper/footer_rss.png" alt="RSS" title="RSS"></a>,<a href="https://t.me/blooper" target="_blank"><img src="/themes/blooper/footer_telegram.png?t=1" alt="Telegram" title="Telegram"></a>,<a href="https://discord.gg/lit" target
预期结果:
<a href="/rss/images/" target
1 - 选择想要的字符串的正确RegExp是什么 2 - 我哪里出错了?我对发动机的工作方式有错误的假设吗?
答案 0 :(得分:0)