-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_cert_pattern.py
More file actions
31 lines (25 loc) · 853 Bytes
/
Copy pathdebug_cert_pattern.py
File metadata and controls
31 lines (25 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""
Fix the TEST_CERT_NO pattern for Iraeta
"""
import re
def test_cert_patterns():
"""Test different certificate patterns"""
test_line = "报告编号 Report No.: 2024-3765-002"
patterns_to_test = [
r"(?:Report No\\.?)[\\s::]*(2024-3765-002)",
r"(?:Report No\\.?|报告编号)[\\s::]*(2024-3765-002)",
r"(2024-3765-002)",
r"\\b(2024-\\d+-\\d+)\\b",
r"(?:Report No\\.|报告编号)[\\s::]*([\\d-]+)"
]
print("🔍 Testing Certificate Patterns:")
print(f"Test line: {test_line}")
print()
for i, pattern in enumerate(patterns_to_test):
matches = re.findall(pattern, test_line)
print(f"Pattern {i+1}: {pattern}")
print(f"Matches: {matches}")
print()
if __name__ == "__main__":
test_cert_patterns()