Regular Expression - cut off string

i have a string that would be like this

"test@here.com, andhere@nowhere.com, here@here.com"

i want it to be converted to

"test@here.com, ..."

thanks
jmingoAsked:
Who is Participating?
 
Harisha M GCommented:
Hi,


$yourstring = q<test@here.com, andhere@nowhere.com, here@here.com>;

$yourstring =~ s/,.*/, .../;

print $yourstring;

---
Harish
0
 
jmingoAuthor Commented:
worked great. thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.