RegEx to find credit card numbers with embedded spaces
问题 We currently have a content compliance in place where by we monitor anything that contains a credit card number with no spaces (e.g 5100080000000000 ) What we need is for a reg ex to pick up credit card numbers that are entered with spaces every 4 digits (eg: 5100 0800 0000 0000 ) We've been looking at alternate reg exs but have not yet found one that works for both scenarios mentioned above. The current reg ex we use is below ^((4\d{3})|(5[1-5]\d{2})|(6011)|(34\d{1})|(37\d{1}))-?\d{4}-?\d{4}