regex not working in tExtractRegexFields

Six Stars

regex not working in tExtractRegexFields

I want to extract the Picklist 'title' from the following url format

 

https://someapi.com:443/odata/v2/Picklist('ContractType')/picklistOptions

 

I've tried using the following which all work in regex online tests

"[^\\/\']+(?=\'[^\']+$)"

 

to extract 'ContractType' from the above url.

 

But this doesn't work in the component.

 


Accepted Solutions
Six Stars

Re: regex not working in tExtractRegexFields

I tried tExtractRegexFields and tJavaRow using java.util.regex.Pattern etc..

 

None of the components worked, however, tMap expression did i.e.

 

regexUtilitiesCompleted.regexData("[^\\/\']+(?=\'[^\']+$)",row1.uri)

 

Not sure why the other components aren't working properly for regex, I'm running Talend v6.1 Date Services.

 

But tMap expression utilities works as it should!


All Replies
Employee

Re: regex not working in tExtractRegexFields

Hi,

 

    Could you please provide some sample input records so that I will get more idea about it?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Nine Stars

Re: regex not working in tExtractRegexFields

try this

"Picklist\\((.*?)\\)"

Regards
Abhishek KUMAR
Six Stars

Re: regex not working in tExtractRegexFields

Thanks for this Abhishek, but this doesn't work either, the component just sends the row output without regex processing, to tLogRow

 

|                                       #1. tLogRow_1                                        |

+-----+--------------------------------------------------------------------------------------+

| key | value                                                                                |

+-----+--------------------------------------------------------------------------------------+

| uri | https://someapi.com:443/odata/v2/Picklist('ContractType')/picklistOptions |

+-----+--------------------------------------------------------------------------------------+

 

.------------------------------------------------------------------------------------------------.

|                                         #2. tLogRow_1                                          |

+-----+------------------------------------------------------------------------------------------+

| key | value                                                                                    |

+-----+------------------------------------------------------------------------------------------+

| uri | https://someapi.com:443/odata/v2/Picklist('ftecontracthours')/picklistOptions |

+-----+------------------------------------------------------------------------------------------+

 

.----------------------------------------------------------------------------------------------------.

|                                           #3. tLogRow_1                                            |

+-----+----------------------------------------------------------------------------------------------+

| key | value                                                                                        |

+-----+----------------------------------------------------------------------------------------------+

| uri | https://someapi.com:443/odata/v2/Picklist('GlobalAssignmentType')/picklistOptions |

+-----+----------------------------------------------------------------------------------------------+

 

.--------------------------------------------------------------------------------------------.

|                                       #4. tLogRow_1                                        |

+-----+--------------------------------------------------------------------------------------+

| key | value                                                                                |

+-----+--------------------------------------------------------------------------------------+

| uri | https://someapi.com:443/odata/v2/Picklist('ToolsofTrade')/picklistOptions |

+-----+--------------------------------------------------------------------------------------+

 

Cheers.

Six Stars

Re: regex not working in tExtractRegexFields

I tried tExtractRegexFields and tJavaRow using java.util.regex.Pattern etc..

 

None of the components worked, however, tMap expression did i.e.

 

regexUtilitiesCompleted.regexData("[^\\/\']+(?=\'[^\']+$)",row1.uri)

 

Not sure why the other components aren't working properly for regex, I'm running Talend v6.1 Date Services.

 

But tMap expression utilities works as it should!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download