I'm trying to extract the degree rate from the CSS transform property,
transform = "rotate(33.8753deg) translateZ(0px)"
with a regular expression. So far I've succeeded to get almost the exact number:
const re = new RegExp('.*rotate( *(.*?) *deg).*', 'm');
let degRate = transform.match(re);
Output: An array which the third element is:
"(33.8753"
- How can I get only the number without the parenthesis?
- How can I get only the number? (not in an array)