Right now I have the regex \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
to match an email address, for this situation that is good.
I have tried various things for csv cell matching but I can't seem to get them to work for this.
What I need is something that matches the regex above, but have a delimiter between, there are three different delimiters '|' ',' ';'
, for example I want to match
example@example.com
example@example.com|example@example.com|example@example.com
example@example.com,example@example.com,example@example.com
example@example.com;example@example.com;example@example.com
I also don't care about whitespace, so it needs to account for them adding extra spaces in, while still accounting for above, for example:
example@example.com | example@example.com|example@example.com
It also needs to be able to use a combination of delimiters
example@example.com,example@example.com;example@example.com|example@example.com
I am doing this in c#
Note, I have looked at this How to match a comma separated list of emails with regex?
But I am not sure how to modify ^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,4},?)+$
to meet my needs
Currently I have
(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*[\s?[,|\||;|]\s?]?)+$