A little help please
-
Im using notepad to try something
i have a lot of trext like this:<host endtime=“1610639975”><address addr=“179.8.138.90” addrtype=“ipv4”/><ports><port protocol=“tcp” portid=“37777”><state state=“open” reason=“syn-ack” reason_ttl=“60”/></port></ports></host>
<host endtime=“1610639976”><address addr=“201.217.248.199” addrtype=“ipv4”/><ports><port protocol=“tcp” portid=“37777”><state state=“open” reason=“syn-ack” reason_ttl=“52”/></port></ports></host>
<host endtime=“1610639977”><address addr=“190.82.98.90” addrtype=“ipv4”/><ports><port protocol=“tcp” portid=“37777”><state state=“open” reason=“syn-ack” reason_ttl=“56”/></port></ports></host>
<host endtime=“1610639977”><address addr=“201.217.253.232” addrtype=“ipv4”/><ports><port protocol=“tcp” portid=“37777”><state state=“open” reason=“syn-ack” reason_ttl=“54”/></port></ports></host>and i need to delete everything and just leave the ips
like this:
179.8.138.90
201.217.248.199
190.82.98.90
201.217.253.232im a newbi on this, and im trying to do this with the “replace” option.
thanks friends!
-
I’m sure there are “tighter” ways to match IP addresses, but I’d probably do this with your data:
Open the Mark dialog by pressing Ctrl+m
find:
\d{1,3}(?:\.\d{1,3}){3}
search mode: regular expressionPress the Mark all button.
This should mark in a color (usually reddish) your IPs.
Press the Copy Marked Text button and then do a paste somewhere else. There’s your data.
-
I assume that the curly quotes in the data you posted are actually straight quotes. If that is the case, then the following regex will do the job:
Search: (?-s).*?addr="([\d.]+)".*?|.* Replace: $1Put the caret at the very beginning of the document, select just the
Regular Expressions modeand click theReplace Allbutton.Take care and have fun!
-
@astrosofista said in A little help please:
$1
great!
thanks a lotthe replace method works for me.
About the Alans Method, a can t find the option “copy marked text” -
@Kathy-Medina said in A little help please:
copy marked text
You’re welcome. To take advantage of the “copy marked text” option you need v7.9.1.
-
@astrosofista said in A little help please:
To take advantage of the “copy marked text” option you need v7.9.1.
…or later!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login