Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be done by using the following:</p> <pre><code>Pattern tags = Pattern.compile ("&lt;/?[^&gt;]+&gt;"); Matcher match = tags.matcher (yourContent); // here you specify the string you want to modify (HTML) String result = match.replaceAll(""); </code></pre> <p>This way you remove any tags, but keep the content in your HTML string.</p> <p>Read more about Pattern and Matcher <a href="http://developer.android.com/reference/java/util/regex/package-summary.html" rel="nofollow">here</a>.</p> <p>EDIT:</p> <p>To remove only links (anchors) from the string, write the following instead of the first line:</p> <pre><code>Pattern tags = Pattern.compile ("&lt;/?[a]{1}[^&gt;]+&gt;"); </code></pre> <p>You can remove an arbitrary string by just replacing the regular expression with another one.</p> <p>EDIT2:</p> <p>I completely misunderstood your question. Two times :)</p> <p>You can remove all <code>&lt;div class="graph"&gt;</code> tags, by doing something like this:</p> <pre><code> Pattern tags = Pattern.compile ("&lt;div class=\"graph\"&gt;[^(&lt;/div&gt;)]+&lt;/div&gt;"); </code></pre> <p>Afterwards, replace all those [[DIV]] placeholders with whatever you want. However, this approach will not work if you have a div with a graph AND some content inside it, though. So in that case, I think it will be best to split all your content on the <code>&lt;div class=graph&gt;</code> and then inspect every DIV inside every element to check if there is a graph inside it.</p> <p>I don't know if this can be done with regular expressions alone, so a more tedious and bug-prone approach will have to be undertaken. But you do want something really specific, so that's something you should expect sometimes :)</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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