Im not too good with regular expressions, but I need a regular expression to do a mongo search in php for emails in a string like this:
[to]=>'jfields@example.com, lknight@example.com, sbeltran@example.com, ltran@example.com'
My specific problem is that I can't get a expression to work to find specifically ltran@example.com
but not sbeltran@example.com
.
I used something like this ['$regex'] = new MongoRegex("/(\W)(".$email.")/");
but then this doesn't find jfields@example.com
because it has no space in front of it. Any help is appreciated.