I’ve a String from a SMS like:
“Your code: 123456. Your reference number is 012. The total amount is E 1250,00..”
Now I need to extract the code ‘123456’, which is different every time, but always 6 digits.
How can I extract this 6 digit number from the string? Can I use Regex expressions somehow? I need to be sure, so I don’t want to split on ‘code: ‘ for example.
EDIT:
The rest of the text can be different, but there will be only 6 digits in the SMS.
The regexpr for a 6 digit number is
Edit:
The code will look like