Re: perl/bash question - html link out of text

2010-03-07 Thread Boyd Stephen Smith Jr.
On Sunday 07 March 2010 11:07:56 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/";>http://somewhere.uk/
> 
> rather output this:
> test string http://somewhere.uk/";>http://somewhere.uk/ test

sed -r 's,(http://[^ \"$]+),\1,'

maybe?
-- 
Boyd Stephen Smith Jr.   ,= ,-_-. =.
b...@iguanasuicide.net  ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/\_/


signature.asc
Description: This is a digitally signed message part.


Re: perl/bash question - html link out of text

2010-03-07 Thread Kumar Appaiah
On Sun, Mar 07, 2010 at 11:12:39AM -0600, Kumar Appaiah wrote:
> On Sun, Mar 07, 2010 at 06:07:56PM +0100, 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/";>http://somewhere.uk/
> > 
> > rather output this:
> > test string http://somewhere.uk/";>http://somewhere.uk/ test
> 
> How about:
> 
> echo "test string http://somewhere.uk/ test" | sed -r 's,(.*)(http://[^ 
> \"$]+).*,\1\2,'

Rather:

echo "test string http://somewhere.uk/ test" | sed -r 's,(.*)(http://[^ 
\"$]+)(.*),\1\2\3,'

Kumar
-- 
Win95 is not a virus; a virus does something.
-- unknown source


signature.asc
Description: Digital signature


Re: perl/bash question - html link out of text

2010-03-07 Thread Kumar Appaiah
On Sun, Mar 07, 2010 at 06:07:56PM +0100, 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/";>http://somewhere.uk/
> 
> rather output this:
> test string http://somewhere.uk/";>http://somewhere.uk/ test

How about:

echo "test string http://somewhere.uk/ test" | sed -r 's,(.*)(http://[^ 
\"$]+).*,\1\2,'

HTH.

Kumar
-- 
Whoa...I did a 'zcat /vmlinuz > /dev/audio' and I think I heard God...
-- mikecd on #Linux


signature.asc
Description: Digital signature


perl/bash question - html link out of text

2010-03-07 Thread Vadkan Jozsef
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/";>http://somewhere.uk/

rather output this:
test string http://somewhere.uk/";>http://somewhere.uk/ test


can some perl/bash gods help me? :)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1267981676.2365.83.ca...@ubuntu