2 Replies Latest reply on Jan 7, 2014 1:50 PM by John L.

    regular expression question

    John L.

      I currently use the regular expression (\b.*[>]Temp:?) to select the following 2 lines:


      <div align="center" class="smTxt">Temp: <span class="smTxt" style="font-weight: bold;">37.8&deg;F</span>

      <div class="smTxt">Temp: 37.8&deg;F</div>


      How can I modify my regular expression to exclude the first of the two selected lines, but not the second?


      Thanks in advance for any help you may be able to provide.

        • 1. Re: regular expression question

          Your requirement is not clear to me. The semantic content of both lines is the same  (Temp: 37.8&deg;F), the rest is just HTML fomatting. Why can you skip the first line but not the second? Schouldn't you look for a way to ignore the <span>-Tag only instead of the whole line? Also I'd recommend a framework for parsing HTML because there may be line breaks that split your line and you may not find it.


          Having sad this a look ahead expression may do it:







          • 2. Re: regular expression question
            John L.

            Thanks for your kid answer. My experience to date with one HTML parsing framework is that it does not live up to the proposed design.


            In the meantime, I'll suffice with regular expressions with the aid of my peers.