Availability:
:- use_module(library(dcg/high_order)).
//
?- phrase(sequence(digit, Digits), `123a`, L). Digits = "123", L = [97] ; Digits = [49, 50], L = [51, 97] ; ...
:- use_module(library(dcg/high_order)).
//
?- phrase(sequence(digit, Digits), `123a`, L). Digits = "123", L = [97] ; Digits = [49, 50], L = [51, 97] ; ...