79160065

Date: 2024-11-05 17:12:44
Score: 1
Natty:
Report link

This is the first response on a google search on how to confirm that a string is valid css. So that's a pretty good answer. :) I would add rem and em to the regex. (\d*)(px|%|em|rem).

And depending on the situation, might want to check that \d is greater than or equal to 0, unless you want people to be able to say that something is -100px wide or something. And allow either '0' or 0.,

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Bob Ramsey