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 :-)

Eleven 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!

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch