When it comes to my product version number, it follows the format "P.Q.R", where P, Q, and R are represented by digits. The acceptable inputs include "P", "P.Q", and "P.Q.R".
I created a regular expression that involves an OR
operation.
(^\d+$) | (^\d+.\d+$) | (^\d+.\d+.\d$)
Is there a more straightforward way to write this using JavaScript?