Sep-26-2018, 09:35 AM
hey all... need a help in regex ..
im trying to get the local ip address form a windows system by running this code : ( i dont want to use python socket )
the cmd result is : IPv4 Address. . . . . . . . . . . : 192.168.74.163
i need to get just this result : 192.168.74.163
how i can do it by regex ??
thanks in advance
im trying to get the local ip address form a windows system by running this code : ( i dont want to use python socket )
import os import re q = os.popen("""ipconfig | findstr /R /C:"IPv4 Address""").read() print q dev = re.findall('[0-9]+' , q) print devthe result is : ['4', '192', '168', '74', '163']
the cmd result is : IPv4 Address. . . . . . . . . . . : 192.168.74.163
i need to get just this result : 192.168.74.163
how i can do it by regex ??
thanks in advance