Replace all places of text that contain ips in brackets with nothing
-
Title! I need help and it would be appreciated!
“max100:[216.36.165.77]naconnin” is one of the examples
-
use regular expression checked,
find what:
\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]
replace with:
[]
\d looks for any digit
{1,3} means digit must occur at least once and at most 3 times
the dot needs to be escaped by backslash if it sholud be used literally, same applies to [ and ]Cheers
Claudia -
@Claudia-Frank said:
[]
Hello Claudia, it doesn’t seem to work. It throws me that nothing was replaced. Is it possible that it would delete all of the stuff inside the brackets?
-
Is you cursor set on first line?
Do you use wrap around setting with file dialog?Cheers
Claudia -
Thank You, it worked!
-
Wait, it doesn’t still seem to delete everything inside the brackets. Sorry for your time but is it possible to make that it will find the brackets and remove everything inside them?
-
it would delete IP’s, is there anything else inside?
If so, what COULD be inside?Cheers
Claudia -
or the other way, is only the text inside the brackets which should be deleted?
If so, find
\[.*\]
and replace with
[]
Cheers
Claudia -
I could tell from the very first posting that things were going to go the way they have…
-
Hi, @patrick-tamm, @claudia-frank and @scott-sumner,
Claudia, regarding your last regex, it would better to use a lazy quantifier, just in case of lines, as below :
This is [an example] of text with [some pairs] of square brackets, in the [same line] !
So a correct regex S/R should be :
SEARCH :
\[.*?\]
REPLACE :
[]
OPTIONS :
Regular expression
andWrap around
and, maybe,. matches newline
if brackets pair are split on two different lines !ACTION : Click on the
Replace All
buttonCheers,
guy038