Skip to content
Advertisement

How to match a string after a token (using regex)?

I’m trying to extract mail addresses after a token ‘eaddr:’. So it would match the all occurrences in line entries, first consecutive string without spaces after that token: I tried:

but it does not work. The correct result set is:

Advertisement

Answer

First of all, I suggest using a better regex to verify the email format. I am inspired by Gordon’s SPLIT_TO_TABLE + LATERAL approach, and wrote some sample queries to fetch those emails from the entries.

If you want to get all the emails together, you can use this one:

To get the exact result in your question, you can use the following query:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement