I need to highlight IP address (IPv4) in Notepad++ while examining server logs. I tried to define a new language with some rules, but without actual success. How to do it?
format is standard, for example: 192.168.0.1 where numbers are from 0-255 separated with dots.
Taken from : http://ehc.ac/p/notepad-plus/discussion/331754/thread/90404ea1/?limit=25
So, to highlight ANY VALID IPv4 address ONLY, in the current text, follow the method below:
Fill in the regex, below, in the Find what field:
\b(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(.(?1)){3}\b
Check the Bookmark line option
^^So i tried it, and it didn't work, and then i spent half an hour trawling the net for a decent reg exp.
Finally i found this which does the reverse of what you are asking, it highlights everything but the ip addressses, go figure....
use: \s.* in the find dialog instead.
Replace everything in the text file after IP Address
Now all you have to do to identify your ip addresses is ignore anything highlighted.
Note this also requires the ip address to be the first thing on a line, so you may have to Doctor your server logs to match this or tweak the regular expression for your specific needs.