regex in tmap for string to double check

Five Stars

regex in tmap for string to double check

Hi,
i have a string field as as input.
i want to check in tmap is Double with help of regex. how can i do it.
Also string to date in format "yyyy-MM-ddTHH:mm:ss"
Regards,
Jugal
Five Stars

Re: regex in tmap for string to double check

ok so i found for date i can use the function Talend.isDate()
but need help for double check
Five Stars

Re: regex in tmap for string to double check

found it too:
row1.num.matches("-?\\d+(.\\d+)?")
Five Stars

Re: regex in tmap for string to double check

found that function Talend.isDate() doesnt help,
string is input,
date is out put in format "yyyy-MM-dd'T'HH:mm:ss"
how can i apply filter if string is date or not in tmap
One Star

Re: regex in tmap for string to double check

Hi Jugal
I think it works fine.
My input string is "2012-04-13T14:17:22".
The expression in tMap is TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss").
And the result is true.
Or I misunderstand what you mean.
Regards,
Pedro
Five Stars

Re: regex in tmap for string to double check

yeah thts correct,
but i want the rejected records to be deleted,
so wat i did is in the main output i keep the filter TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss")
for the 2nd out in the tmap i select "Catch output reject"
& tht out frm the tmap is directed to delete rows db2 output
but somehow allows all the rows valid
One Star

Re: regex in tmap for string to double check

Hi
'Catch output reject' will work when there is join in tMap.
Why don't you use the filter expression as below in out2?
TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss")==false

Regards,
Pedro
Five Stars

Re: regex in tmap for string to double check

sorry it was typo error in tmap filter
thx for the help
One Star

Re: regex in tmap for string to double check

Hi,
    I m new to Talend.I need to use Data quality regular expression in data integration job for filtering datas. any one help me