Build, test, and debug regular expressions
Matches groups of four consecutive digits only when they are followed by another digit, using a positive lookahead. This pattern effectively captures every quartet of digits in a number except the final group, making it ideal for credit card masking, where you need to identify all digit blocks that precede the last one. Commonly used with substitution to format or hide parts of card numbers.