The long solution:
Validating credit card numbers is the ideal job for regular expressions. They're just a sequence of 13 to 16 digits, with a few specific digits at the start that identify the card issuer. You can use the specific regular expressions below to alert customers when they try to use a kind of card you don't accept, or to route orders using different cards to different processors. All these regexes were taken from RegexBuddy's library.
If you just want to check whether the card number looks valid, without determining the brand, you can combine the above six regexes into
You'll see I've simply alternated all the regexes, and used a non-capturing group to put the anchors outside the alternation. You can easily delete the card types you don't accept from the list.
You don't have to use some regular expression to validate the credit card numbers. I doubt if this would even give the correct result. Because there are some rules that have to be applied to the number.
If you would have searched with google you would have seen that credit card numbers can be validated with the Luhn algorithm. The luhn algorithm can be implemented in java see the last link. And in microflow you could check which prefix is used and which card issuer has that prefix.
Wiki explanation: http://www.chriswareham.demon.co.uk/software/Luhn.java
Explanation of the algorithm and cardtype prefix: http://www.beachnet.com/~hstiles/cardtype.html
Java example: http://www.chriswareham.demon.co.uk/software/Luhn.java
You can find a library with a lot of regular expression at this website.
Ps. use google you can find a lot of reg ex on internet.