So copy paste the entire page, get all the crap that you don't want too, it's fine.
In *nix (or anywhere Perl is installed):
- Code: Select All
while ($l = <>){foreach $m(split /\s+/, $l){if($m =~ /^[-\w.]+@([a-z0-9][a-z-0-9]+\.)+[a-z]{2,4}$/i ){print $m . "\n";}}}
In Windows (untested):
- Code: Select All
@echo off
set INPUT_FILE=results.txt
set OUTPUT_FILE=emails.txt
set "REGEXP=[\.A-Z\-_][\.A-Z\-_]*@[\.A-Z\-_][\.A-Z\-_]*"
>nul copy nul %OUTPUT_FILE%
for /f "tokens=*" %%a in (%INPUT_FILE%) do for %%b in (%%a) do (
for /f %%z in ('echo %%b ^| findstr /R /I "%REGEXP%"') do (
echo %%z >> %OUTPUT_FILE%
)
)
You still need to copy-paste, but now you can copy paste the entire page, and don't have to filter it manually.
(Incidentally, I actually answered this question within a few hours of it being asked, but I don't like the Perl, it feels kludgey, so I asked if anyone had any better ideas first, and until now, they don't. I mean, it works, it just isn't elegant).