import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		final String regex = "^([a-zA-Z0-9]+)\\s+Confirmed\\.on\\h+(\\d{1,2}/\\d{1,2}/\\d\\d)\\h+at\\h+(\\d{1,2}:\\d{1,2})\\w*Ksh(\\d+(?:\\.\\d+)?).*?\\bfrom\\h+(\\d+)\\h+([^.]+)\\.";

		final String string2 = "PFEDDTYG0D Confirmed.on 14/6/21 at 12:46PMKsh260.00 received from 254725400049 JOHN DOE. New Account balance is Ksh1,666. Transaction cost, Ksh1";
        final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
        final Matcher matcher = pattern.matcher(string2);

        if(matcher.find()) {
            String code = matcher.group(1);
            String amountReceived = matcher.group(4);
            String tel = matcher.group(5);
            String from = matcher.group(6);
            String date = matcher.group(2);
            String time = matcher.group(3);

            String format = "code: %s amount received: %s from: %s date: %s time: %s tel: %s";
            System.out.println(String.format(format, code, amountReceived, from, date, time, tel));
        }
	}
}