Create an instant of an inline pattern. Arguments: pattern: A regular expression that matches a pattern. md: An optional pointer to the instance of `markdown.Markdown` and is available as `self.md` on the class instance.
(self, pattern: str, md: Markdown | None = None)
| 195 | md: Markdown | None |
| 196 | |
| 197 | def __init__(self, pattern: str, md: Markdown | None = None): |
| 198 | """ |
| 199 | Create an instant of an inline pattern. |
| 200 | |
| 201 | Arguments: |
| 202 | pattern: A regular expression that matches a pattern. |
| 203 | md: An optional pointer to the instance of `markdown.Markdown` and is available as |
| 204 | `self.md` on the class instance. |
| 205 | |
| 206 | |
| 207 | """ |
| 208 | self.pattern = pattern |
| 209 | self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern, |
| 210 | re.DOTALL | re.UNICODE) |
| 211 | |
| 212 | self.md = md |
| 213 | |
| 214 | def getCompiledRegExp(self) -> re.Pattern: |
| 215 | """ Return a compiled regular expression. """ |