'How can I turn this regex formula into an array?

I have a regex function for a column in Google sheets which is something like below:

=REGEXEXTRACT(E2,"\Q"&REGEXREPLACE(E2,"\w\S*@\S+\w","\\E(.*)\\Q")&"\E")

I am trying to turn this into an array so that it applies to the whole column but its not working. I tried this:

=REGEXEXTRACT(E2:E,"\Q"&REGEXREPLACE(E2:E,"\w\S*@\S+\w","\\E(.*)\\Q")&"\E")

Any solution would be of great help.



Solution 1:[1]

Keep in mind that we can't see your spreadsheet. We don't know your data or what you are trying to do. That said, you have to start by marking the formula as an array formula by wrapping it in ArrayFormula( ):

=ArrayFormula(REGEXEXTRACT(E2:E,"\Q"&REGEXREPLACE(E2:E,"\w\S*@\S+\w","\\E(.*)\\Q")&"\E"))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Erik Tyler