--Boundary_(ID_6zU3/wC6ZvY5pbY2Y/cdiA)
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: quoted-printable

On Aug 12, 2011, at 07:28 AM, Glen Holcomb <damnbigman / gmail.com> wrote:
[...]
> Now as to why I'm looking for the \s before and the \s or $ after. It
> turns         ܢ> Agent\"=\"Mozilla ...\""\n

So, after a little digging on Stackoverflow I decided to try an explicit
lookahead. For what ever reason it works.

/\s(".*?")(?=\s|$)/ matches where /\s(".*?")(\s|$)/ won't.
It sounds like you have a solution, but don't understand it. I'd like to help you understand it, but I don't understand what you're trying to match. The sample string you provide above does not match your regex (and obviously so, as there is never whitespace before a quote)

Could you please provide a single string that you're matching against, and describe what you are trying to match?-Boundary_(ID_6zU3/wC6ZvY5pbY2Y/cdiA)
Content-type: multipart/related;
 boundaryoundary_(ID_6hjNC/lPLtMMSbby3dBETQ)"; typeext/html"


--Boundary_(ID_6hjNC/lPLtMMSbby3dBETQ)
Content-type: text/html; CHARSET=US-ASCII
Content-transfer-encoding: 7BIT

<html><body><div>On Aug 12, 2011, at 07:28 AM, Glen Holcomb &lt;damnbigman / gmail.com&gt; wrote:</div><div>[...]</div><div><blockquote type
ite"><div classsg-quote"><div classstretch">&gt; Now as to why I'm looking for the \s before and the \s or $ after. It<br> &gt; turns&nbsp;out that some of the user agent strings are in a format like "\"Custom<br> &gt; Agent\"Mozilla ...\""\n<br><br> So, after a little digging on Stackoverflow I decided to try an explicit<br> lookahead. For what ever reason it works.<br> <br> /\s(".*?")(?|$)/ matches where /\s(".*?")(\s|$)/ won't.</div></div></blockquote><span>&nbsp;</span></div><div><span>It sounds like you have a solution, but don't understand it. I'd like to help you understand it, but I don't understand what you're trying to match. The sample string you provide above does not match your regex (and obviously so, as there is never whitespace before a quote).</span></div><div><span><br></span></div><div><span>Could you please provide a single string that you're matching against, and describe what you are trying to match?</span></div></body></html> --Boundary_(ID_6hjNC/lPLtMMSbby3dBETQ)-- --Boundary_(ID_6zU3/wC6ZvY5pbY2Y/cdiA)--