mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-07 12:36:47 +00:00
💡 add plugin docstring
This commit is contained in:
@ -238,6 +238,10 @@ def regex(regex: str, flags: Union[int, re.RegexFlag] = 0) -> Rule:
|
||||
:参数:
|
||||
* ``regex: str``: 正则表达式
|
||||
* ``flags: Union[int, re.RegexFlag]``: 正则标志
|
||||
|
||||
\:\:\:tip 提示
|
||||
正则表达式匹配使用 search 而非 match,如需从头匹配请使用 ``r"^xxx"`` 来确保匹配开头
|
||||
\:\:\:
|
||||
"""
|
||||
|
||||
pattern = re.compile(regex, flags)
|
||||
|
Reference in New Issue
Block a user