input: Write a python function to extract the top 10 most common words from a text file.
  assert extract_top_words('test1.txt') == [('hello', 3), ('world', 2), ('example', 2), ('python', 1), ('code', 1), ('test', 1), ('function', 1), ('file', 1), ('data', 1), ('words', 1)]
  assert extract_top_words('test2.txt') == [('a', 5), ('of', 4), ('the', 3), ('is', 2), ('in', 2), ('to', 2), ('and', 1), ('for', 1), ('with', 1), ('by', 1)]
output: def extract_top_words(filename):
      from collections import Counter
      import re
  
      with open(filename, 'r') as file:
          text = file.read().lower()
          
      words = re.findall(r'\b\w+\b', text)
      counter = Counter(words)
      most_common_words = counter.most_common(10)
      
      return most_common_words