Mbpp/607

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度531 字符
模型生成的代码 (531 字符)
import re
def find_literals(text: str, pattern: str):
    """
    Search a string for a regex pattern and return the matching substring, 
    start index, and end index.
    
    Args:
        text: The input string to search.
        pattern: The regex pattern to look for.
    
    Returns:
        A tuple (matched_substring, start_index, end_index) if a match is found,
        otherwise None.
    """
    match = re.search(pattern, text)
    if match:
        return (match.group(), match.start(), match.end())
    return None
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试