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