I got this match to match everything except the last email
Could I use look ahead to ignore the last comma not being there?
I've come up with this
can it be improved?
1 person found this helpful
I think its best to simply whenever possible, especially when regular expressions are involved.
I would use the String function split() to get an array of email addresses. You can split using a comma, and then use a two stage regex for your validation.
1) strip any whitespace from the start and end of each email
2) validate each email address
Just in terms of code readability I think this might be the preferred approach.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
Flex / AIR Development, Training, and Support Services