You are here: PSPad forum > English discussion forum > How to extract all links from plain text?

How to extract all links from plain text?

Goto Page: Previous1 2 3 4 5 Next

#11 Re: How to extract all links from plain text?

Posted by: pspad | Date: 2020-01-07 20:09 | IP: IP Logged

Great decision. Use another editor and please another forum too.

Options: Reply | Quote | Up ^


#12 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-07 20:57 | IP: IP Logged

pspad:
To extract URL, you can start with Find dialog and press [!] button
If regular expression doesn't fit, modify it as you need

Not Working Unicode URLs and Special URLs

[Window Title]
Info

[Content]
Next occurrence of "(news|http|ftp|https):\/\/[\w\-_]+(\.[\w]+)+([\w\-\.,@?^=%&&:/~\+#]*[\w\-\@?^=%&&/~\+#])?" not found.

[OK]

This is a better and simple and working regular expression compared to the one proposed in the "!" Button.

(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/).+

Edited 5 time(s). Last edit at 2020-01-07 21:02 by maki.

Options: Reply | Quote | Up ^


#13 Re: How to extract all links from plain text?

Posted by: pspad | Date: 2020-01-08 04:20 | IP: IP Logged

It wont eork if behind url is another text.

Test your expression on lines:

www.example.com some another text
maki is clever boy (ironic)

Answering to your question and requests is waste of time

Options: Reply | Quote | Up ^


#14 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-08 10:11 | IP: IP Logged

White spaces should be ignored by advanced settings: Link
White spaces can be replaced with "," and changed to a CSV file to copy only the link in the first cell.

Options: Reply | Quote | Up ^


#15 Re: How to extract all links from plain text?

Posted by: pspad | Date: 2020-01-08 10:25 | IP: IP Logged

maki:
White spaces should be ignored by advanced settings: Link
White spaces can be replaced with "," and changed to a CSV file to copy only the link in the first cell.

Did you test your wrong regular expression on lines I have sent you as example?
Do you want to tell me that
http://maki////is/correct\URL?
Your expression will find it.

Maybe you have only one URL on each line and nothing else.
Maybe you made lot of manual steps on your files before you will find your URLs. But I don't think so, cause you are too lazy do one additional click.

Options: Reply | Quote | Up ^


#16 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-08 10:49 | IP: IP Logged

Ok.
The most perfect expression, ignores whitespace, text and other characters at the end of the line.

Boost.Regex Engine:
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

www.w3.org you're

Edited 2 time(s). Last edit at 2020-01-08 10:50 by maki.

Options: Reply | Quote | Up ^


#17 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-09 13:42 | IP: IP Logged

maki:
Ok.
The most perfect expression, ignores whitespace, text and other characters at the end of the line.

Boost.Regex Engine:
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

www.w3.org you're

UPDATE: Unfortunately, this regex does not work correctly throughout the text.
I wrote other working Universal(!) Regex URL that looks for all urls in any text.

Regex works only on tested Boost.Regex, Regex++ and Onigmo engines.

I don't know what PSPasd engine maybe Perl and Basic Regex. But it doesn't work in PSPad, it returns an error.

Options: Reply | Quote | Up ^


#18 Re: How to extract all links from plain text?

Posted by: pspad | Date: 2020-01-09 14:28 | IP: IP Logged

Send me examples of URL's what are not recognized by expression from PSPad

Options: Reply | Quote | Up ^


#19 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-09 14:48 | IP: IP Logged

Where are the export settings and the result in a new TAB?
Match String Only

Any line, detect url contained in any mixed text.

www.1.com example.com 1

[Window Title]
Info

[Content]
Occurrence of "www.1.com example.com 1" was found 1 times

[OK]
Wrong, shoulbe 2 match (2 url)
www.1.com
example.com

Edited 3 time(s). Last edit at 2020-01-09 14:53 by maki.

Options: Reply | Quote | Up ^


#20 Re: How to extract all links from plain text?

Posted by: maki | Date: 2020-01-14 10:32 | IP: IP Logged

??? smiling smiley

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 4 5 Next





Editor PSPad - freeware editor, © 2001 - 2020 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR