String: 'Purchase Appln : 2157551 - DIRECT 1,23.00 1,234.23'
Output result should be
str1 = 'Purchase Appln : 2157551 - DIRECT';
str2= '1,23.00 1,234.23';
Please help me to create a regex expression to get that desired result.
Use positive lookaround with String.split method:
String input = "Purchase Appln : 2157551 - DIRECT 1,23.00 1,234.23";
String[] result = input.split("(?<=DIRECT) ");
System.out.println(Arrays.toString(result));
Will print that you need
[Purchase Appln : 2157551 - DIRECT, 1,23.00 1,234.23]