Mbpp/607

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度371 字符
模型生成的代码 (371 字符)
import re
def find_literals(text: str, pattern: str):
    """
    Search the given text for the regex pattern and return a tuple
    (matching_substring, start_index, end_index) for the first match.
    If no match is found, return None.
    """
    match = re.search(pattern, text)
    if match:
        return (match.group(), match.start(), match.end())
    return None
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试