相关文章推荐

Within a Derived Column activity in ADF Data flow I am trying to use regexExtract(string, \d{7} ) to extract a 7-digit number.

If I use the same regex \d{7} in regexReplace(string, \d{7} , ''), this works fine and removes any numbers 7-digits long.

An example of a string I'd like to extract 7-digit number from is:
6833041#ASDFG RGTDS2, Some Name1,7181711#ASDFG RGTDS2, Some Name2

The desired result is 6833041 and 7181711 extracted.

Am I missing something with regexExtract? The only example of its use is the example in the documentation, nothing else seems to work.
https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expression-functions#regexExtract

Thanks!

Can you try this? The key with match groups in regex syntax is to include the parenthesis for the expression:

regexExtract('6833041#ASDFG RGTDS2, Some Name1,7181711#ASDFG RGTDS2, Some Name2', '(\\d{7})')
											

Thank you! I was missing the extra back slash.

I had 163304-image.png with back quotes because with approstophie it was throwing an error 163314-image.png I had also tried both with brackets too.

Do you know if its also possible to extract all existing match groups? Without knowing how many there might be.

Hi @Casey-3168 ,

Thank you for follow up query. Do you mean to check all matches? If yes, regexMatch() may helpful to you. Feel free to open new question for follow up query for detailed discussion.

If above answers helps with your query, then please consider marking it as Accepted Answer. Accpected answers helps community as well. Thank you.

 
推荐文章