As the title said, I want to match ip address with batch in windows, please tell me how I can do it?
I see that “findstr” can match with regex like “[0-9]“, but how can “findstr” matches it appears one to three times?
As the title said, I want to match ip address with batch in windows,
Share
Since
findstr‘s regex support is a bit … dated, you usually can’t use most regexes you find on the web. The following matches four runs of digits, separated by dots:However, if you’re only interested in addresses and not the subnet masks, you might want to use
And yes, if would also match things like
Address: 232345.534.78678.345which is obviously not an IP address. But usuallyipconfigdoesn’t spit out such strings.