import os import re import sys # Define a regex for emojis # This pattern matches common emoji characters emoji_pattern = re.compile( "[" "\U00010000-\U0010ffff" # All supplementary Unicode characters (includes most emojis) "\u2600-\u27bf" # Miscellaneous symbols, dingbats "\u2300-\u23ff" # Miscellaneous technical "\u2b50" # Medium white star "\u2934-\u2935" # Arrows "\u3297" # Congratulation sign in circle "\u3299" # Secret sign in circle "]", flags=re.UNICODE ) src_dir = "/home/fmq/program/AstroResearch/dashboard/src" found = False for root, dirs, files in os.walk(src_dir): for file in files: if file.endswith(('.tsx', '.ts')): path = os.path.join(root, file) try: with open(path, 'r', encoding='utf-8') as f: for line_num, line in enumerate(f, 1): matches = emoji_pattern.findall(line) if matches: print(f"{path}:{line_num}: {' '.join(matches)} -> {line.strip()}") found = True except Exception as e: print(f"Error reading {path}: {e}") if not found: print("No emojis found.")