I am trying to extract year, month and days data from the string 1 year, 5 months and 4 days.
Similarly, I want to be able to convert 1/2/4 into 1 year, 2 months and 4 days
In both case, I would like to handle day vs days or remove days if they are 0.
What is the best way to do this?


String.match().