how to remove dublicate proxies in list? [duplicate] - regex

This question already has answers here:
Removing duplicate rows in Notepad++
(17 answers)
Closed 3 years ago.
i have a proxy list like this :
5.5.5.5:62359
4.4.4.4:95684
6.6.6.6:65419
4.4.4.4:95684
7.7.7.7:65487
now i want to convert top list to this :
5.5.5.5:62359
4.4.4.4:95684
6.6.6.6:65419
7.7.7.7:65487
--> i want to remove dublicate proxies in list
are there any website or program or notepad++ regex that do this ?

It's very easy to do it in sublime text. just open the file and eidt -> permute lines -> unique

You may find the answer here. But it will not work without sorting alphabetically.
Search
^(.*)(\r?\n\1)+$
Replace
\1
The find and replace with regex function worked on Notepad++.
But, it doesn't work on visual studio code.

Related

Regex to pull out text between two strings [duplicate]

This question already has answers here:
Regex catch string between two strings, multiple lines
(4 answers)
Closed 2 years ago.
I'm trying to get the text from the [QOUTE] and [/QUOTE] but can seem to get it correctly. I'm just trying to pick it out and delete it. So I want to extract the text within as well as the actual HTML [QUOTE] parts. Just want to get rid of that entire code block via regex:
What I'm working with:
\[QUOTE(.+)|\[\/QUOTE]|
Text Example:
[QUOTE="", post: 1910681, member: 001""]
This is where the quote is located
[/QUOTE]
[URL unfurl=""true""]https://www.google.com[/URL]
Assuming those tags can't be nested, you can use the following regex with the single-line flag to match the tags and their content :
\[QUOTE\b.*?\[/QUOTE]
You can try it here.

Notepad++ move the end of a line to the front [duplicate]

This question already has answers here:
notepad++ reg expressions to swap two values
(4 answers)
Closed 2 years ago.
I have a csv file with movie data but some of the titles have the starting word at the end of the title for example
281,River Wild, The
282,Time to Kill, A
need to be
281,The River Wild
282,A Time to Kill
For anyone wondering the solution was to use a regular expression
,(.+?), (.+?)$
and the replace with
,$2$1
and click on regular expression and wrap around

Sublime text regex - remove text in parenthesizes [duplicate]

This question already has answers here:
My regex is matching too much. How do I make it stop? [duplicate]
(5 answers)
How can I remove text within parentheses with a regex?
(9 answers)
Closed 4 years ago.
I am having list on telephone numbers in my js file, and some of them have in parenthesizes translations that I don't need:
Azerbaijan (Azərbaycan)
I wont to find regex in sublime to do that, but I cannot find the right command. I have tried:
((.))
((*))
\(.*)\
\(.*\)
But I aways remove something different ... If someone know the solution, please help.
Ok as Paul Bak said the (.*) works at his computer, and it does work, just that my js file is compressed all in same line so it removes everything after the (...
I beautified js and use this regex and now it is solved.

regular expression find all the http within [test](http://) [duplicate]

This question already has answers here:
My regex is matching too much. How do I make it stop? [duplicate]
(5 answers)
Closed 6 years ago.
I have tried hrs for this regex and couldn't sort it out, and seek for some help.
/\[.*\]\((https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g
Here is the link to my regex page link
https://regex101.com/r/Xc5zDp/1
I try to pick out all the links in the sentence and example like this [link](http://test.com), but it keep select both links all together
Simplify your regex to this: \[.*?\)
Is this what you want? Demo

Matching multiple occurrences with regex [duplicate]

This question already has answers here:
My regex is matching too much. How do I make it stop? [duplicate]
(5 answers)
Closed 3 years ago.
I'm building an extractor in Graylog to pull tac_plus syslog data.
I have a log:
<70>Oct 13 10:10:05 auth tac_plus[17354]: 2015-10-13 10:10:05 -0500#01110.10.89.1#011jmartinez#011tty132#01110.10.1.27#011stop#011task_id=146#011timezone=CDT#011service=shell#011start_time=1444747732#011priv-lvl=15#011cmd=show running-config <cr>
I want to extract the indvidual statements between the #011 markers. I was able to get the first section, the IP with:
(?<=#011)(.*?)(?=#011)
Now I want to extract the 'jmartinez'. I'm trying:
#011.*?#011(.*)(#011)
but it matches:
jmartinez#011tty132#01110.10.1.27#011stop#011task_id=146#011timezone=CDT#011service=shell#011start_time=1444747732#011priv-lvl=15
if i do:
#011.*?#011(.*)(#011tty)
it seems to work but i'd rather it not rely on seeing #011tty because it might be something else in another message.
what about the next one? how can I extract tty132, 10.10.1.27, stop, task_id=146, etc
any help would be greatly appreciated!
The simple answer is to use a reluctant quantifier (just like your working IP capture):
#011.*?#011(.*?)#011
But I would go further and capture all groups at once, eg:
#011(.*?)#011(.*?)#011(.*?)#011(.*?)#011(.*?)#011(.*?)#011