in reply to Regex for e-mail contacts name
The regex matches any word character, ".", "," or space within double quotes and deletes that.
#!/usr/bin/perl -w use strict; my $string = 'sean@gmail.com, "richard J. Smith, M.D." <richard@gmail. +com>, "john" <john@gmail.com>, <jack@gmail.com>'; $string =~ s/\"[\w .,]+"//g; print $string; #sean@gmail.com, <richard@gmail.com>, <john@gmail.com>, <jack@gmail. +com>
|
|---|