Change to /translateX\((-?\d+|-?\d*\.\d+)px\)/i to also allow no leading decimal, a valid value in CSS.