in reply to REGEX:extract url/urls from aline

URL's have so many possible formats that this is one of the relatively few instances where I personally wouldn't even bother messing with regex. Use a code library, as suggested. But for your specific case:

use strict; use warnings; $_ = 'www.scvckj.com agdsvejdvvws xwsjwswj www.wdxvecbc.com swgvdec ww +w.asdvedj.com'; @_ = m/www\..*?\.com/g; print join "\n", @_;

Or if you want to add a few other suffixes:

@_ = m/www\..*?\.(?:com|net|org|edu)/g;