MCPcopy Create free account
hub / github.com/Felixgithub2017/MMCU / find_valid_substrings

Function find_valid_substrings

TestChatGLM.py:14–20  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

12choices = ["A", "B", "C", "D"]
13
14def find_valid_substrings(s):
15 # 匹配长度为1到4的、不包含重复字符的子串
16 pattern = r'[ABCD]{1,4}'
17 substrings = re.findall(pattern, s)
18 # 过滤出不包含重复字符的子串
19 valid_substrings = [substring for substring in substrings if len(substring) == len(set(substring))]
20 return valid_substrings
21
22def format_subject(subject):
23 l = subject.split("_")

Callers 1

evalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected