Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var str='第一个视频<iframe frameborder="0" width="640" height="498" src="https://v.qq.com/iframe/player.html?vid=a0678a3ahqx&tiny=0&auto=0" allowfullscreen=""></iframe>第二个视频<iframe frameborder="0" width="640" height="498" src="https://v.qq.com/iframe/player.html?vid=a0678a3ahqx&tiny=0&auto=0" allowfullscreen=""></iframe>没有了'
var result=str.replace(/(<iframe) (.*) (width=\".*?\") (height=\".*?\") (.*)(<.*?iframe>)/g,"$1 $2 width='100%' $5 $6")
console.log(result)
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers