MediaWiki API ヘルプ
このページは自動生成された MediaWiki API の説明文書ページです。
説明文書と例: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
action=regexblock
(main | regexblock)
- このモジュールは読み取りの権限を必要とします。
- このモジュールは書き込みの権限を必要とします。
- このモジュールは POST リクエストのみを受け付けます。
- ソース: RegexBlock
- ライセンス: GPL-2.0-or-later
Block users' names and IP addresses via regular expressions.
パラメーター:
- regex
The regular expression to block. Note that when the "exact" param is given in the URL, this is not treated as a regular expression but rather as a simple string.
- この変数は必須です。
- expiry
Expiry time. May be relative (e.g. 5 months or 2 weeks) or absolute (e.g. 2014-09-18T12:34:56Z). If set to infinite, indefinite, or never, the block will never expire.
- 既定: never
- reason
Reason for block.
- 既定値: (空)
- nocreate
Prevent account creation.
- 型: 真偽値 (詳細)
- exact
Use exact matching to block the given name precisely as given (as opposed to treating it as a regular expression).
- 型: 真偽値 (詳細)
- token
action=query&meta=tokens から取得した「csrf」トークン
- この変数は必須です。
例:
- Block the exact IP address "192.0.2.5" for three days with the reason "First strike"
- api.php?action=regexblock®ex=192.0.2.5&expiry=3%20days&reason=First%20strike&exact=&token=123ABC [サンドボックスで開く]
- Block the regular expression "SpamUser.*" permanently, which blocks any and all users whose user name matches that expression, such as "SpamUser65", with the reason "Bad username" and also prevent any and all users whose user name matches the regular expression from creating new user accounts.
- api.php?action=regexblock®ex=SpamUser.*&expiry=never&reason=Bad%20username&nocreate=&token=123ABC [サンドボックスで開く]