I'm writing an application that involves having users enter time's in the following format:
1m30s # 1 Minute, 30 Seconds
3m15s # 3 Minutes, 15 Seconds
2m25s # 2 Minutes, 25 Seconds
2m # 2 Minutes
55s # 55 Seconds
The data can have a single "minute designation", a single "second designation", or both. What is the proper way to parse these strings into a format similar to:
{
"minutes" : 3
"seconds" : 25
}