Merge pull request #184 from reventlov/re_fullmatch

Use `re.fullmatch` instead of `re.match`.
diff --git a/compiler/back_end/cpp/header_generator.py b/compiler/back_end/cpp/header_generator.py
index e638471..6a66461 100644
--- a/compiler/back_end/cpp/header_generator.py
+++ b/compiler/back_end/cpp/header_generator.py
@@ -1761,8 +1761,8 @@
     if attr.name.text != attributes.Attribute.NAMESPACE:
         return
     namespace_value = ir_data_utils.reader(attr).value.string_constant
-    if not re.match(_NS_RE, namespace_value.text):
-        if re.match(_NS_EMPTY_RE, namespace_value.text):
+    if not re.fullmatch(_NS_RE, namespace_value.text):
+        if re.fullmatch(_NS_EMPTY_RE, namespace_value.text):
             errors.append(
                 [
                     error.error(
@@ -1772,7 +1772,7 @@
                     )
                 ]
             )
-        elif re.match(_NS_GLOBAL_RE, namespace_value.text):
+        elif re.fullmatch(_NS_GLOBAL_RE, namespace_value.text):
             errors.append(
                 [
                     error.error(
diff --git a/compiler/front_end/attribute_checker.py b/compiler/front_end/attribute_checker.py
index d1df30c..9c867d2 100644
--- a/compiler/front_end/attribute_checker.py
+++ b/compiler/front_end/attribute_checker.py
@@ -45,8 +45,8 @@
 
 def _valid_back_ends(attr, module_source_file):
     """Checks that `attr` holds a valid list of back end specifiers."""
-    if not re.match(
-        r"^(?:\s*[a-z][a-z0-9_]*\s*(?:,\s*[a-z][a-z0-9_]*\s*)*,?)?\s*$",
+    if not re.fullmatch(
+        r"(?:\s*[a-z][a-z0-9_]*\s*(?:,\s*[a-z][a-z0-9_]*\s*)*,?)?\s*",
         attr.value.string_constant.text,
     ):
         return [