最後活躍 1738920994

get_suffix.go 原始檔案
1func getSuffix(fileName string) string {
2 regex := `\.[^\.]*$`
3 re, _ := regexp.Compile(regex)
4 foundSuffix := re.FindString(fileName)
5 if len(foundSuffix) <= 5 {
6 return foundSuffix
7 }
8 return ""
9}
10
get_suffix.py 原始檔案
1def get_suffix(name):
2 m = re.search(r"\.[^\.]*$", name)
3 if m.group(0) and len(m.group(0)) <= 5:
4 return m.group(0)
5 else:
6 return ""