MCPcopy
hub / github.com/cft0808/edict / safe_name

Function safe_name

scripts/utils.py:37–40  ·  view source on GitHub ↗

检查名称是否只含安全字符(字母、数字、下划线、连字符、中文)

(s: str)

Source from the content-addressed store, hash-verified

35
36
37def safe_name(s: str) -> bool:
38 """检查名称是否只含安全字符(字母、数字、下划线、连字符、中文)"""
39 import re
40 return bool(re.match(r'^[a-zA-Z0-9_\-\u4e00-\u9fff]+$', s))
41
42
43def python_bin() -> str:

Callers 3

add_remoteFunction · 0.90
update_remoteFunction · 0.90
remove_remoteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected