From mark at opus11.net Fri Jun 5 20:20:10 2015 Content-Type: multipart/mixed; boundary="===============1493649139339337553==" MIME-Version: 1.0 From: Mark Knoop To: users at lists.fedoraproject.org Subject: Re: perl/bash question - html link out of text Date: Sun, 07 Mar 2010 17:18:32 +0000 Message-ID: <20100307171832.1e9a24f8@brahms> In-Reply-To: 1267981674.2365.82.camel@ubuntu --===============1493649139339337553== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable At 18:07 on 07 Mar 2010, Vadkan Jozsef wrote: > I don't know how to modify the: > = > sed -r 's,.*(http://[^ \"$]+).*,\1,' > = > command, to not just: > $ echo "test string http://somewhere.uk/ test" | sed -r > 's,.*(http://[^ \"$]+).*,\1,' > http://somewhere.uk/ > = > rather output this: > test string http://somewhere.uk/ > test $ echo "test string http://somewhere.uk/ test" | \ sed -r 's,(.*)(http://[^\"$ ]+)(.*),\1\2\3,' -- = Mark Knoop --===============1493649139339337553==--