I want to collect ID card number for any 4 listed ID cards available to the respondents but each of the cards has different number of digits

Welcome to the community @Bilqis! You could do this as outlined in our support article Restricting Text Responses With Regular Expressions. As a sample workaround you could also have a look to the following community post discussed previously.

This post discussed previously should be very relevant to solve your issue: