Validating and matching time interval string to number

I am trying to implement validator and converter that will accept string including time interval parts, check if it’s valid and convert to number of hours.

const validStrings = ["1day 5h", "1d 5hours", "1 days 5"]
// output should be 29

Currently I get all possible day and hours string units from Intl.DisplayNames object, depending on user locale and including “short”, “narrow” and “long” names (day, d, hour, hr…etc) and trying to match my string against those names splitting string into hours and days part and then extracting numeric parts.

The problem is that those units can be in plural form in different languages.

Is this something that requires my own custom implementation or there any known library that can handle this validation and conversion?