(a) select the 6 digits number from the beginning or 9 digits. Examples
“123456789” -> “123456789”
“1234567895” -> “123456789”
“12345678” -> nil
“12345” -> nil
(b) select the first 6 or 9 characters. Examples
I wouldn’t use a single regex to solve this - I’d use multiple checks
and if statements. I’d try to give you an example if I could understand
your rules, you’re not clear about when to follow which rules.
I wouldn’t use a single regex to solve this - I’d use multiple checks
and if statements. I’d try to give you an example if I could understand
your rules, you’re not clear about when to follow which rules.