Question: 
Write a function that matches a word containing 'z', not at the start or end of the word.


Model's Code:
def text_match_wordz_middle(text):
    import re
    pattern = r'\b\w*z\w*\b'
    if re.search(pattern, text) and not re.search(r'\bz\w*|\w*z\b', text):
        return 'Found a match!'
    else:
        return 'Not matched!'



Sample Correct Code:
import re
def text_match_wordz_middle(text):
        patterns = '\Bz\B'
        if re.search(patterns,  text):
                return 'Found a match!'
        else:
                return('Not matched!')


Asserts:
assert text_match_wordz_middle("pythonzabc.")==('Found a match!')
assert text_match_wordz_middle("xyzabc.")==('Found a match!')
assert text_match_wordz_middle("  lang  .")==('Not matched!')


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 643 of 974: 479/643 (74.4945567651633%): success