I am developing Android App to read OTP from SMS and give user option to directly copy the OTP in clipboard.
Now problem is SMS can be as follow:-
- Time: 02:30 PM Your OTP is 3242. (otp can be of any digits).
- 12345 is your OTP. TIME: 04:45 AM.
- Your OTP for account 123456789 is 4565.
I need help to extract otp using Pattern and Matchers in java. or any other simple solution to get otp. Third case can be ignored. It will also work if we can get 4 or 5 or 6 digit numbers from SMS using Pattern and Matchers.