Page 1 of 1

newbie - extract a url

Posted: Thu Nov 18, 2004 7:33 am
by mikertjones
Hello

Just starting out with TextPipePro and I have managed some fairly basic stuff.

However, this one is testing me.

I have a sample line:

</A>&&Web http://www.neddys.com/</A>

and I just want to extract the whole url

I tried EasyPattern [(Hyperlink)] replace with $1://$2 but that just gave me http://www.n

$0 contains http://www.n
and $3 is empty

How can I get the full url?

Thank you for any help

Mike Jones

Posted: Thu Nov 18, 2004 10:13 am
by DataMystic Support
Hi Mike,

This EP and [EmailAddress] are not working correctly - a fix will be in the next release.

For now, use this perl pattern for [Hyperlinks]
(?:(ftp|http|https|telnet|gopher|nntp)://([_a-z\d\-]+(?:\.[_a-z\d\-]+)+)((?:[_a-z\d\-\\\./]+[_a-z\d\-\\/])+)*?)

and this one for [EmailAddress]
(?:\b([_a-z0-9-]+(?:\.[_a-z0-9-]+)*)@([_a-z0-9-]+(?:\.[_a-z0-9-]+)*?)\.(?:[a-z]{2,4}?)\b)

Posted: Thu Nov 18, 2004 6:32 pm
by mikertjones
Thanks Simon

Still can't get it to work, though.

Input text is </A>&&
Web http://www.neddys.com/</A>

Find pattern is:

(?:(?:(?:(?:(ftp|http|https|telnet|gopher|nntp)://([_a-z\d\-]+(?:\.[_a-z\d\-]+)+)((?:[_a-z\d\-\\\./]+[_a-z\d\-\\/])+)*?))))

(Your post had emoticons after the question marks near the start - I assumed they should be colons)

I have find type set to Pattern (perl)

In the replace with field I have put $1://$2

When I run the Trial Run the original text is repeated - i.e. no change.

If I tick the checkbox for Extract matches - nothing appears in the Trial output pane.

I'm sure it's me doing something wrong and I do appreciate your help.

Thank you

Mike Jones

Posted: Thu Nov 18, 2004 7:04 pm
by DataMystic Support
Drop me an email. The forums are corrupting the text.