pattern = r'(\d{3})-(\d{3})-(\d{4})'
text = '我的电话号码是123-456-7890'
match = re.search(pattern, text)
if match:
print("完整匹配结果:", match.group())
print("第一个分组:", match.group(1))
print("第二个分组:", match.group(2))
print("第三个分组:", match.group(3))
print("所有分组:", match.groups())
print("匹配起始位置:", match.start())
print("匹配结束位置:", match.end())
print("匹配位置范围:", match.span())
print("原始字符串:", match.string)