How to write reg_extract in informatica expression to fetch multiple email id from text

193 views Asked by At

I am trying to build the logic in informatica to fetch the email id from free text using reg_extract but its not working as expect.I have tried using this logic [a-zA-Z0-9-.]+@[a-zA-Z0-9-.]+[a-zA-Z].Can someone please help with this.

Input:

Data storing in column is string within that email ids are present. Need to fetch email ids.There is no fixed pattern. Example :

Field 1 
test – test12 – [email protected] - [email protected]    
abc - [email protected] - [email protected] - [email protected]
[email protected]@[email protected]
[email protected]@[email protected]
cde  [email protected]
Comment generated by:Please contact : [email protected] for any queries

Output:

Field 1
[email protected]/[email protected] 
[email protected]/[email protected]/[email protected]
[email protected]/[email protected]/[email protected]
[email protected]/[email protected]/[email protected]
[email protected]
[email protected]
1

There are 1 answers

0
Maciejg On

If you read the doc on REG_EXTRACT cerefuly, you will notice it does not perform extracts of multiple occurences of some given pattern. What it rather does, is it lets you split the whole string into array and extract one element.

I'm afraid it's not simple and the only possible way might be by using multiple variable ports. If at all possible.