Template:String count/doc
| This is a documentation subpage for Template:String count. It may contain usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
This template counts the number of strings on the specified page. It uses the most recent saved version of a page, so if used on the current page it will not work correctly in preview mode.
Usage
Plain search
{{string count|page=page|search=text to search for}}
Search with Lua patterns
{{string count|page=page|search=pattern to search for|plain=false}}
Parameters
page- the page to search on.search- the string or Lua pattern to search for.plain- set to "false" to search with a Lua pattern instead of plain text.
Lua patterns
A Lua pattern is a special string that can match several different strings. For people who know regular expressions, Lua patterns are similar, but more limited. See the following documentation for how to construct patterns:
- Introduction to Lua patterns
- Scribunto ASCII pattern documentation
- Scribunto unicode string pattern documentation
Note: This module uses Unicode-safe Scribunto functions, so there is no need to make special exceptions for Unicode characters. However, some character classes may behave differently to the ASCII pattern character classes, so see the Unicode string pattern documentation for the most accurate description.
Examples
{{string count|page=Wikipedia:Administrators' noticeboard/Incidents|search=admin}}→ 93{{string count|page=Wikipedia:Administrators' noticeboard/Incidents|search=[Aa]dmin|plain=false}}→ 131
TemplateData
TemplateData for String count
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page name | page | The name of the page on Wikipedia to search.
| Page name | required |
| Search Query | search | What to search for on the specified page | Unbalanced wikitext | required |
| Plain text? | plain | Is the search query plain text? If not, it is treated as a Lua patten.
| Boolean | suggested |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.