I have a string like below -
<html>
<head>
</head>
<body>
<p>***Some Text***.</p>
<p><iframe allowfullscreen="" frameborder="0" height="360" src="//www.some-domain.com/embed/mwOFWJUOpv8" width="600"></iframe></p></body>
I want to replace some of parameters in the iframe tag at the bottom of string as -
<iframe allowfullscreen="" frameborder="0" height="new vlaue" src="//www.some-domain.com/embed/mwOFWJUOpv8" width="new value"></iframe>
I can successfully grab out string starting from "<iframe" to "</iframe>" with the required changes. I am getting problem to replace that whole <iframe ...</iframe> with new string.
So my result should be like this -
<html>
<head>
</head>
<body>
<p>***Some Text***.</p>
<p><iframe allowfullscreen="" frameborder="0" height="new vlaue" src="//www.some-domain.com/embed/mwOFWJUOpv8" width="new value"></iframe></p></body>
EDIT : - I have followed this approach, but could not replace whole iframe tag in string.
Please help me out!