sqlalchemy.strip - python examples

Here are the examples of the python api sqlalchemy.strip taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : worker.py
Copyright MIT License
Author : chaoss
    def is_has_link(self, s, md_content):
        # remove leading whitespace if exist
        s = s.strip()
        pattern_inline = re.compile(r'\[([^\[\]]+)\]\(([^)]+)')
        match = pattern_inline.match(s)

        if match:
            return match.group(1), match.group(2)

        pattern_ref = re.compile(r'\[([^\[\]]+)\]\[([^]]+)')
        match2 = pattern_ref.match(s)

        if match2:
            link = match2.group(2)
            p = re.compile(r'\n\[' + link + r'\]:\s+(.+)\n')
            res = p.search(md_content, re.DOTALL)
            if res:
                return match2.group(1), res.group(1)
        else:
            return s, None