Commits

Takeshi Komiya committed 55a804d

Optimize regexp

  • Participants
  • Parent commits bbf0ef3

Comments (0)

Files changed (1)

File src/schema2rst/inspectors/base.py

 class Column(dict):
     def set_comment(self, comment, options=[]):
         extra_comment = ", ".join(options)
-        match = re.match('^(.*?)(?:\(|()(.*)(?:\)|))\s*$', comment)
+        match = re.match('^(.*?)(?:[((](.*)[))])\s*$', comment)
         if match:
             self['fullname'] = match.group(1).strip()
             self['comment'] = match.group(2).strip()