def extract_hostname(fqdn):
__pattern = r'([^\\.]+).+'
regex = re.compile(__pattern, re.MULTILINE)
for match in regex.finditer(fqdn):
return match.group(1)
Created
March 5, 2015 06:50
-
-
Save masudak/4e4b29f3129d78d4d955 to your computer and use it in GitHub Desktop.
正規表現
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment