Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
synfield
Contributor III
Contributor III

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.

 

Labels (2)
1 Solution

Accepted Solutions
synfield
Contributor III
Contributor III
Author

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!

View solution in original post

4 Replies
Anonymous
Not applicable

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 🙂

akumar2301
Specialist II
Specialist II

try this

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

synfield
Contributor III
Contributor III
Author

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.

synfield
Contributor III
Contributor III
Author

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!