Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Regular expression syntax certainly isn't universal. See my <a href="http://www.regular-expressions.info/refflavors.html" rel="nofollow noreferrer">regex flavor comparison</a>. Unfortunately the Yahoo Pipes docs don't say what regex flavor they use. The examples look like Perl-style regexes, so that's what I'll use.</p> <p>To remove a specific HTML tag (e.g. <code>span</code>) with a specific class attribute (e.g. <code>someclass</code>), search for:</p> <pre><code>(?si)&lt;span[^&lt;&gt;]*class=["']?someclass["']?[^&lt;&gt;]*&gt;(.*?)&lt;/span&gt; </code></pre> <p>and replace with:</p> <pre><code>$1 </code></pre> <p>The above regex will fail if the <code>span</code> tag you're trying to remove contains a nested <code>span</code> tag.</p> <p>To delete any <code>a</code> tag that has an <code>img</code> tag as the first thing in its content, search for:</p> <pre><code>(?si)&lt;a[^&lt;&gt;]*&gt;(&lt;img.*?)&lt;/a&gt; </code></pre> <p>and replace with:</p> <pre><code>$1 </code></pre> <p>The third item in your question cannot be done with regular expressions alone. You'll need a facility to increment the number in the replacement. I don't know if Yahoo Pipes supports something like that. You don't really need a regex. Simply search for the text <code>&lt;a</code> and replace with <code>&lt;a class="link001"</code></p> <p>Of course, all the caveats about manipulating HTML/XML with regular expressions apply. The regexes work on the examples you gave, but they may not work as intended on every possible piece of HTML.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload