Good day! I have a line like this

9д20ч 18 мин 

How can I parse this line to bring it back to normal? In some cases, the date will not be days. That is, I somehow need to know these numbers and arrange everything with variables. Thank you in advance!

Closed due to the fact that off-topic participants Alexey Shimansky , Bald , user194374, Denis Bubnov , Denis 22 Dec '16 at 7:49 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Alexey Shimansky, Bald, Community Spirit, Denis Bubnov, Denis
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Something like this:

     (\d+\s*д)?.*?(\d+\s*ч)?.*?(\d+\s*м)?