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
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$
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.
These regular expressions will easily catch numbers that are invalid because the customer entered too many or too few digits. They won't catch numbers with incorrect digits. For that, you need to follow the Luhn algorithm, which cannot be done with a regex. And of course, even if the number is mathematically valid, that doesn't mean a card with this number was issued or if there's money in the account. The benefit or the regular expression is that you can put it in a bit of JavaScript to instantly check for obvious errors, instead of making the customer wait 30 seconds for your credit card processor to fail the order. And if your card processor charges for failed transactions, you'll really want to implement both the regex and the Luhn validation.
Source: here
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.
http://regexlib.com/
Ps. use google you can find a lot of reg ex on internet.