Change regex to match %-d or %-m

The old regex not match %-e or %-m format.