From jozsi.avadkan at gmail.com Fri Jun 5 20:20:10 2015 Content-Type: multipart/mixed; boundary="===============0413439937270198027==" MIME-Version: 1.0 From: Arthur Bela To: users at lists.fedoraproject.org Subject: perl/bash question - html link out of text Date: Sun, 07 Mar 2010 18:07:54 +0100 Message-ID: <1267981674.2365.82.camel@ubuntu> --===============0413439937270198027== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 can some perl/bash gods help me? :) --===============0413439937270198027==-- From mark at opus11.net Fri Jun 5 20:20:10 2015 Content-Type: multipart/mixed; boundary="===============2419384296179968213==" 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 --===============2419384296179968213== 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 --===============2419384296179968213==--