Fellow Monasterians,
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):
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
and I want to end up with:
barney@gmail.com wilma@aol.com
so far I have:
(?-m).+constant=(\w+@\w+\.com)(?-m).+
but keep ending up with:
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
Obviously, I need to use multiple lines, but not sure how to do it in grep vs a Perl regexp.
In reply to grep question using multiple lines by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |