Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open (MYFILE, 'data.txt');
- while (<MYFILE>) {
- chomp;
- my @words = split(' ');
- foreach my $word (@words) {
- if($word =~ /.+@.+..{2,6}/) {
- print "$_n";
- }
- }
- }
- use Email::Valid;
- open (MYFILE, 'data.txt');
- while (<MYFILE>) {
- chomp;
- my @words = split(' ');
- foreach my $word (@words) {
- if(Email::Valid->address($word)) {
- print "$wordn";
- }
- }
- }
- print "$_n";
- print "$wordn";
- open (MYFILE, 'data.txt');
- while (<MYFILE>) {
- chomp;
- my @words = split(' ');
- foreach my $word (@words) {
- if($word =~ /^[^@]+@+[^.]+.+[^.]{2,6}$/) {
- print "$wordn";
- }
- }
- }
- me@me.com mine@mine.co.uk myself@email.net
- me@me.com mine@mine.in myself@email.ru
- me@me.com mine@mine.co.uk myself@email.america
- Output
- ------
- me@me.com
- myself@email.net
- me@me.com
- mine@mine.in
- myself@email.ru
- me@me.com
- /bw+(.?[*+-=^$#!~?w])*@w+(.?[*+-=^$#!~?w])*w+b/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement