newbie - extract a url

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

mikertjones

newbie - extract a url

Postby mikertjones » Thu Nov 18, 2004 7:33 am

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

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Thu Nov 18, 2004 10:13 am

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)
Last edited by DataMystic Support on Fri Nov 19, 2004 6:53 am, edited 1 time in total.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

mikertjones

Postby mikertjones » Thu Nov 18, 2004 6:32 pm

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

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Thu Nov 18, 2004 7:04 pm

Drop me an email. The forums are corrupting the text.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest