Skip to content

Instantly share code, notes, and snippets.

@LGM-AdrianHum
Created August 28, 2023 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LGM-AdrianHum/9f7295038f0099793c96bc09f69e170d to your computer and use it in GitHub Desktop.
Save LGM-AdrianHum/9f7295038f0099793c96bc09f69e170d to your computer and use it in GitHub Desktop.
IP Tools : A regex static function to extract IP addresses from strings (good for DNS services that return extra data with IP addresses.
private static string ExtractIpAddress(this string input) => string.Join("", Regex.Matches(input, @"[\d\.]+"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment