• I am not in a place where I can test, but it seems like simply adding a .* before and after the regex that matches your CC# pattern would make it work for any string.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato