Unfortunately we don't currently have an equivalent to the POSIX regexp that would allow one to specify the minimum and maximum number of occurence for a given string as follow:
^12345 ([0-9]_){1,4}$
Given the available regexp set, your as-path list is probably the best I could come up with.
Hope this helps,
Regards,
Harold Ritter, CCIE #4168 (EI, SP)