Sublime Forum

Regex not working in Sublime Text 2 build 2163

#1

In order to have descriptions end up on one line I use this regex pattern to remove html leading whitespace and html all whitespace:
Find All

 \s*(<>])\s* 

Replace All

$1

which would take a description such as this:

[code]





  • 6.1 oz., 100% preshrunk cotton jersey knit t-shirt.
  • Seamless double-needle stitched rib knit 7/8" collar.
  • Taped neck and shoulders.
  • Tubular knit construction.
  • Double-needle stitched sleeve and bottom hems.
  • Featured on page 94 in our 2008 catalog.
    *NOTE: Ash is 99/1,
    Antique Cherry Red, Antique Irish Green, Antique Royal & Sport Grey are 90/10 &
    Dark Heather, Heather Cardinal, Heather Indigo, Heather Navy, Heather Sapphire, Safety Green, Safety Orange & Safety Pink are 50/50
    Safety Green and Safety Orange are Compliant with ANSI/ISEA 107-2010 High Visibility Certified for Use as Background Colors

    Adult:
    S, M, L, XL, 2XL, 3XL, 4XL, 5XL
    [/code]

    and turn it into this

    <br /><a href="http://www.domain.com/specs/xx.pdf" target= _blank onmouseover="image2.src='http://www.domain.com/images/download.jpg';" onmouseout="image2.src='http://www.domain.com/images/download.jpg';" /><img src="http://www.domain.com/images/download.jpg" width="175" height="25" alt="" border="0" name="image2" /></a> <br /><li>6.1 oz., 100% preshrunk cotton jersey knit t-shirt. <li>Seamless double-needle stitched rib knit 7/8" collar. <li>Taped neck and shoulders. <li>Tubular knit construction. <li>Double-needle stitched sleeve and bottom hems. <li>Featured on page 94 in our 2008 catalog. <br><b>*NOTE:</b> Ash is 99/1, <br>Antique Cherry Red, Antique Irish Green, Antique Royal & Sport Grey are 90/10 & <br>Dark Heather, Heather Cardinal, Heather Indigo, Heather Navy, Heather Sapphire, Safety Green, Safety Orange & Safety Pink are 50/50<br><sup>&dagger;</sup>Safety Green and Safety Orange are Compliant with ANSI/ISEA 107-2010 High Visibility Certified for Use as Background Colors <br /><br /><b>Adult:</b><br>S, M, L, XL, 2XL, 3XL, 4XL, 5XL <br />

    which allowed the description to fit on 1 line, but using the above regex now results in the description fitting on 3 lines instead of one. Is this regex incorrect

    Nvrmind the anchor tag is throwing the regex off

  • 0 Likes