Home Download Buy Blog Forum Support

Regex not working in Sublime Text 2 build 2163

Regex not working in Sublime Text 2 build 2163

Postby capnhud on Wed Jan 11, 2012 6:03 pm

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
Code: Select all
\s*([<>])\s*


Replace All
Code: Select all
$1


which would take a description such as this:

Code: Select all
<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 />


and turn it into this
Code: Select all
<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
capnhud
 
Posts: 62
Joined: Thu Jan 14, 2010 11:57 am

Return to General Discussion

Who is online

Users browsing this forum: meigallodixital and 13 guests