I am trying to isolate an email address from a block of free field text (column name is TEXT).
There are many different variations of preceding and succeeding characters in the free text field, i.e.:
email me! john@smith.com
e:john@smith.com m:555-555-5555
john@smith.com--personal email
I've tried variations of INSTR()
and SUBSTRING_INDEX()
to first isolate the "@"
(probably the one reliable constant in finding an email...) and extracting the characters to the left (up until a space or non-qualifying character like "-"
or ":"
) and doing the same thing with the text following the @
.
However - everything I've tried so far hasn't filtered out the noise to the level I need.
Obviously 100% accuracy isn't possible but would someone mind taking a crack at how I can structure my select statement?