Quote:
Originally Posted by firsikov
Hi there!
I have code like that:
Code:
<p class="text">some text</p>
<blockquote class="email">
<p class="text">some <i>text</i></p>
<p class="text"><b>some</b> text</p>
<p class="text">some text</p>
</blockquote>
<p class="text">some text</p>
And i need to change class of P tag only inside of blockquote tag.
Regex search string, like " <blockquote class="email">(.*?)<p class="text">(.*?)</blockquote>" work only if blockquote have only one p tag.
I don't understand, how to create correct search string or even how to ask google for it.
Hope for your help. Thanks.
|
Just to check, you want to change the class of the paragraph within the blockquote from "text" to something else? If so, it does work, but, you need to have the "Dot all" option selected. And the replace string is:
Code:
<blockquote class="email">\1<p class="newclassname">\2</blockquote>
But, I would do this with:
Code:
(<blockquote class="email">.*?<p class=")text(">.*?</blockquote>)
And the substitution is:
Which is basically to use all the put the constant bits into groups and the bit you want to change not selected. This also needs the "Dot all" option to be selected.
For both, you have to run them multiple times. If you do "Replace all", it only makes one change in each blockquote.