Reputation: 719
(another question, sorry but stressing for exam).
I have a file I am going to read in from STDIN. It has text and bunch of emails in the text.
"blah blah blah something [email protected] blah blah [email protected]".
i want to replace all email addresses domain name with "@example.com". So the above becomes
"blah blah blah something [email protected] blah blah [email protected]"
Here is the code i have so far.
#!/usr/bin/perl
while($line = <STDIN>){
$line =~ s/'@'+'.com'\s/"@example.com"/g;
print $line;
}
Upvotes: 0
Views: 110