improved extractdigit without borders