Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My input string format is ''24-OCT-23 05.22.45.513000000 AM GMT' and I want to Reject otherthan this pattern and saving in a oracle table.
How we can filter this and reject wrong formats in the input values :
for example 1: ''24-OCT-23 05.22.45.513000000'
for example 2: ''24-OCT-23 05.22.45.513000000 AM'
Hi
You can create an routine function to check the date pattern using regex expression, call the routine function on tFilterRow to filter the rows.
eg:
public static boolean checkDatePattern(String str)
{
boolean isDate=false;
String datePattern ="\\d{2}-\\w{3}-\\d{2} \\d{2}.\\d{2}.\\d{2}.\\d{9} \\w{2} \\w{3}";
return isDate=str.matches(datePattern);
}
Regards
Shong