# Syntax Error: Invalid syntax

**URL:** <https://discuss.python.org/t/syntax-error-invalid-syntax/6303>\
**Category:** Python Help\
**Tags:** help\
**Created:** [December 22, 2020, 3:22pm UTC](https://discuss.python.org/t/syntax-error-invalid-syntax/6303 "2020-12-22T15:22:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyo723](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kyo723](https://discuss.python.org/u/kyo723)\
**Post date:** [December 22, 2020, 3:22pm UTC](https://discuss.python.org/t/syntax-error-invalid-syntax/6303/1 "2020-12-22T15:22:45Z")

</div>

Hi All,

I’m a beginner of python and have been doing some prac.  
I’ve got this syntax error when I tried to use re.compile function.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/2X/0/087411c8d5c4662580a641d95d949eba140a4190.png)

then it gave me the syntax error for line 133.

Can someone please advise me what I did wrong?

---

<div class="post-metadata">

**Author:** ![aroberge](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/aroberge/32/6200_2.png) [@aroberge](https://discuss.python.org/u/aroberge)\
**Post date:** [December 22, 2020, 5:17pm UTC](https://discuss.python.org/t/syntax-error-invalid-syntax/6303/2 "2020-12-22T17:17:09Z")

</div>

“\</match\_word\>” is not valid Python syntax. Perhaps you meant to include it in the string inside re.compile().

---

<div class="post-metadata">

**Author:** ![kyo723](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kyo723](https://discuss.python.org/u/kyo723)\
**Post date:** [December 24, 2020, 7:27am UTC](https://discuss.python.org/t/syntax-error-invalid-syntax/6303/3 "2020-12-24T07:27:46Z")

</div>

Thanks Aroberge!! it works!!  
Happy X-mas and all the best for you and your family!!
