perlquestion
bradcathey
<p>Fellow Monasterians,</p>
<p>I'm trying to isolate some code in BBEdit using the grep functionality offered (Perl friendly). Here are 6 lines of text containing 2 email addresses (this is just an example, and could be looking for anything, actually):</p>
<blockquote><code>f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
hfedls74d8oHFx constant=barney@gmail.com alUF9dejuH()NF
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
hfedls74d8oHFx constant=wilma@aol.com alUF9dejuH()NFui0
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
</code></blockquote>
<p>and I want to end up with:</p>
<blockquote><code>
barney@gmail.com
wilma@aol.com
</code></blockquote>
<p>so far I have:</p>
<blockquote><code>
(?-m).+constant=(\w+@\w+\.com)(?-m).+
</code></blockquote>
<p>but keep ending up with:</p>
<blockquote><code>
f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
barney@gmail.com
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
wilma@aol.com
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
</code></blockquote>
<p>Obviously, I need to use multiple lines, but not sure how to do it in grep vs a Perl regexp.</p>
<div class="pmsig"><div class="pmsig-273627">
—Brad<br /><small><i>"The important work of moving the world forward does not wait to be done by perfect men."</i> George Eliot</small><br>
</div></div>