RegEx: Get number and unit from a css property string in JavaScript
Monday, April 4th, 2011var numeric = "12px".match(/\d+/); var unit = "12px".match(/\D+$/);
Source: stackoverflow: convert css units
var numeric = "12px".match(/\d+/); var unit = "12px".match(/\D+$/);
Source: stackoverflow: convert css units
RegEx to select the content of div.code
Result:
<div class="cdeBlock">
<div class="cdeLbl">HTML: /snowReport?resort=Tahoe</div>
<div class="code html"><p>Hello, there are ${m.newSnowInch} inches
of new Snow in ${r.p.resort} </p></div>
</div>
<div class="cdeBlock">
RegEx to select all the caps and numbers
Result: