19 lines
709 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import re
pattern = re.compile(r'(\b\d+\s*\.\s*\d+\s*\.\s*\d+\b)|(\b3\s*\.\s*2\b)')
text = '3.1.3已标价工程量清单中漏报了某个工程子目的单价、合价或总额价则漏报的工程 子目单价、合价和总额价视为已含入其他工程子目的单价、合价和总额价之中。'
match = pattern.search(text)
if match:
print("匹配成功:", match.group())
else:
print("未找到匹配")
# 使用 findall 查看所有匹配
all_matches = pattern.findall(text)
print("所有匹配:", all_matches)
# 打印文本的前10个字符的ASCII值检查是否有不可见字符
print("文本前10个字符的ASCII值:")
for char in text[:10]:
print(f"{char}: {ord(char)}")