title: Remove HTML from NSString but keep maths symbols
body: <p>I need to strip out all HTML formatting from an NSString but I need to retain any &lt; (less than) symbols when relevant to the string's contents.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;p&gt;Dogs:  For dogs &lt;10KGs use 1:1000 solution (1000 µg/ml) diluted to 5-10 ml.&lt;/p&gt;
  </code></pre>
  
  <p>I need this to read:</p>
  
  <pre><code>Dogs:  For dogs &lt;10KGs use 1:1000 solution (1000 µg/ml) diluted to 5-10 ml.
  </code></pre>
  
  <p>So far the common approach is to use something along the lines of:</p>
  
  <pre><code>  NSRange r;
    NSString *s = [[self copy] autorelease];
    while ((r = [s rangeOfString:@"&lt;[^&gt;]+&gt;" options:NSRegularExpressionSearch]).location != NSNotFound)
    s = [s stringByReplacingCharactersInRange:r withString:@""];
    return s;
  </code></pre>
  
  <p>But this method results in:</p>
  
  <blockquote>
    <p>Dogs: For dogs</p>
  </blockquote>
  
  <p>The first HTML tag is stripped correctly but the &lt;10KGs is assumed to be the opening of an HTML tag with p> closing is it and so removing that whole section.</p>
  
  <p>How can I handle &lt; when it is used for content and not tags?</p>