0

I'm well aware of the dangers of parsing HTML with Regular Expressions but I'm in a pickle and need to speed things up! I have this code block:

<div class="row">
    <div class="span1"><i class="fc-icon-letterpress-circle"></i>
    </div>
    <div class="span4">This design is letterpressed onto the finest quality salvaged paper made here in the USA.</div>
</div>
<div class="row">
    <div class="span1"><i class="fc-icon-madeinusa-circle"></i>
    </div>
    <div class="span4">We work hard to be able to say that this product is proudly created right here in the USA.</div>
</div>
<div class="row">
    <div class="span1"><i class="fc-icon-cotton-circle"></i>
    </div>
    <div class="span4">This product is made from tree-free paper sourced from salvaged cotton from the textile industry.</div>
</div>

And I need it to be transformed to this:

letterpress-circle, "This design is letterpressed onto the finest quality salvaged paper made here in the USA.";
madeinusa-circle, "We work hard to be able to say that this product is proudly created right here in the USA.";
cotton-circle, "This product is made from tree-free paper sourced from salvaged cotton from the textile industry.";

Preferably with one regular expression, in sublime text

This is what I have so far.

.+i class=\"fc-icon-(.+)\".+
$1
Community
  • 1
  • 1
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424

1 Answers1

0

This is what I landed on:

<div class=\"row\">
    <div class=\"span1\"><i class=\"fc-icon-(.+)\"></i>
    </div>
    <div class=\"span4\">(.+)</div>
</div>
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424