I have a question about the the usage of non-capturing group (?:...).
\b4[0-9]{12}(?:[0-9]{3})\b
(?:\d[ -]*?){13,16}\b
In the first case, the string extracted would have 13 or 16 digits. Whether the last 3 digits appear or not is based on the condition of the string because of the parenthesis even if {3} in the parenthesis asks for exactly the 3 digits? In the second case, I tested the re and found that only digits were counted into the the length of the string. Dash and space is not counted into the length, although they are put in the same parenthesis in from the boundary of string length. Does anyone know the reason?
Thanks