Notepad++ extract string (IP and proxy example)


Example #1 - Find IP address

(\d+\.\d+\.\d+\.\d+)(.*)
\1



EXAMPLE #2 - Extract proxy list

193.219.103.112 8080 ES Spain elite proxy no yes 2 seconds ago
92.222.70.213 3128 FR France elite proxy no yes 2 seconds ago
193.219.103.116 8080 ES Spain elite proxy no yes 2 seconds ago
193.219.103.114 8080 ES Spain elite proxy no yes 2 seconds ago

193.219.103.115 8080 ES Spain elite proxy no yes 2 seconds ago


1) Find IP:port regular expression - (\d+\.\d+\.\d+\.\d+)(\s)(\d+)



2) Replace all space-symbol (tab-symbol) between the ip and port on the ":"



3) Replace all space-symbol on the "\n"


OR



And so we get:


193.219.103.112:8080
ES
Spain
elite proxy
no
yes
2 seconds ago
92.222.70.213:3128
FR
France
elite proxy
no
yes
2 seconds ago
193.219.103.116:8080
ES
Spain
elite proxy

4) Remove the extra lines

Result: 193.219.103.112:8080
92.222.70.213:3128
193.219.103.116:8080
193.219.103.114:8080
193.219.103.115:8080

Комментариев нет:

Отправить комментарий