Created
October 21, 2024 22:12
-
-
Save baldwinsung/0660ded205ef2e8663cf2e1c0754886e to your computer and use it in GitHub Desktop.
just need the ip network. not the entire ip address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re | |
import sys | |
foo = "192.168.1.1" | |
bar = re.sub (r'\b(\d+\.\d+\.\d+)\.\d+\b', r'\1.0', foo ) | |
print (bar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment