import re

def find_mismatched_text_tags(file_path):
    with open(file_path, 'r', encoding='utf-8') as f:
        lines = f.readlines()
        
    stack = []
    print(f"Scanning {file_path}...")
    for i, line in enumerate(lines):
        # Use a better regex to find opening and closing tags separately
        open_tags = re.findall(r'<text\b', line)
        close_tags = re.findall(r'</text>', line)
        
        for _ in open_tags:
            stack.append(i + 1)
        for _ in close_tags:
            if stack:
                stack.pop()
            else:
                print(f"  Extra closing tag </text> at line {i+1}")
    
    for line_num in stack:
        print(f"  Unclosed <text> tag at line {line_num}")

find_mismatched_text_tags(r'd:\骅锋\mall\pages\mall\admin\order\order-configuration\index.uvue')
find_mismatched_text_tags(r'd:\骅锋\mall\pages\mall\admin\order\order-statistics\index.uvue')
find_mismatched_text_tags(r'd:\骅锋\mall\pages\mall\admin\order\list.uvue')
