 | 此模板文档被引用于约39,000个页面。 为了避免造成大规模的影响,所有对此模板文档的编辑应先于沙盒、测试样例或您的沙盒上测试。 测试后无误的版本可以一次性地加入此模板文档中,但是修改前请务必于讨论页发起讨论。
模板引用数量会自动更新。 |
{{Title year}}
或
{{Title year|match|nomatch|page=}}
或
{{Title year|match=|nomatch=|page=}}
模板参数
| 参数 | 描述 | 类型 | 状态 |
|---|
| 匹配实例 | 1 match | 如果找到多个3位或4位数字,此参数指定返回第几个匹配项,其中第一个匹配项对应 match=1。如果指定负数,则从最后一个匹配项开始倒数返回。因此 match=-1 等同于请求最后一个匹配项。默认为1。 - 默认值
- 1
| 数字 | 可选 |
|---|
| 无匹配文本 | 2 nomatch | 如果未找到3位或4位数字的年份,则输出“nomatch”值。默认为空白。
| 字符串 | 可选 |
|---|
| 覆盖页面标题 | page | 指定要使用的页面标题,而非当前页面标题。如果留空,模板将使用当前页面的标题。 - 默认值
- {{BASEPAGENAME}}
| 页面名称 | 可选 |
|---|
字符串处理模板 |
|---|
|
|---|
| 根据数量处理 | | | | {{str right}} | 返回从左向右移除若干个字符后的字符串 | | {{str rightc}} | 返回从后向前指定数量的字符串,如果字符串为空则返回一个参数 | | {{str sub old}} | To trim down to a specified number, starting at a given number from the left. | | {{str sub new}} | Select a substr based on starting and ending index. | | {{str index}} | 返回字符串的第×个字符 |
|
|
|---|
| 根据条件处理 | |
|---|
| 专用于Wiki语法 | | | | {{WikiProjectbasename}} | Removes "WikiProject" from a pagename. | | {{remove unranked}} | Removes the string "unranked_" from the left of a string (taxonomy). | | {{ship prefix}} | Returns the length of a ship's name prefix, if listed (ship names). | | {{title year}} | Returns the 4-digit year from a pagename, if any. |
|
|
|---|
|
|
插入、替换、长度 |
|---|
| {{strloc insert}} | Inserts a string at character location strloc, or appends if strloc<=0. | | {{loop}} | 特定次数重复字串。 | | {{replace}} | 在字串中查找并全部替换某字串后返回。 | | {{str rep}} | 在字串中查找并替换首次出现的某字串后返回。 | | {{digits}} | 移除字串中不是数字(0~9)的字元。 |
|
|
|
|
|
|