Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Apr 2022 22:51:21 +0200
From:      Ralf Mardorf <ralf-mardorf@riseup.net>
To:        questions@freebsd.org
Subject:   Re: extracting an IPv4 address from text?
Message-ID:  <20220402225121.607ad2e9@archlinux>
In-Reply-To: <25160.44484.392802.868667@jerusalem.litteratus.org>
References:  <25160.44484.392802.868667@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Did you already search the Internet for objections and suggestions?
The search strings I would try would include "ip", "grep" or "awk" and
probably "regex". You might want to add "posix" or "freebsd" [1].
Or just "parse text for ip adress" and see what Google suggests else,
such as

"extract ip address from text python"
"extract ip addresses from log file"

I didn't read, but if needed I would start reading:

https://www.google.de/search?q=grep+ipv4+regex
https://www.google.de/search?q=awk+ip+address+regex
https://www.shellhacks.com/regex-find-ip-addresses-file-grep/
https://stackoverflow.com/questions/39306393/awk-print-lines-starting-with-regex-ip-address
https://www.unix.com/shell-programming-and-scripting/175125-awk-equivalent-regex.html

https://www.google.de/search?q=parse+text+for+ip+address

etc. and than do some trial and error tests and if needed come back to
the mailing list with "I tried this or that, but it fails if...".

[1]
Searches tend to be attracted by GNU
https://www.cyberciti.biz/faq/grep-regular-expressions/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220402225121.607ad2e9>