I have the following string
translate3d(0px, -26px, 0px) scale(1);
And I have the following regex
(\d+)(?!.*\d)
The problem is that my regex just matches the last int number and not float. How to modify it in order to recognize also the last float number in a string?
To match float number you can use following regex
\d+(?:\.\d+)?(?!.*\d)
If the ending is always );
then you can use following regex
\d+(?:\.\d+)?(?=\);$)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.