https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AString_count
Modul:String count - Versionsgeschichte
2025-07-27T12:48:36Z
Versionsgeschichte dieser Seite in Wikipedia
MediaWiki 1.45.0-wmf.11
https://de.wikipedia.org/w/index.php?title=Modul:String_count&diff=152847039&oldid=prev
Krd: 2 Versionen von :en:Module:String_count importiert
2016-03-25T11:08:43Z
<p>2 Versionen von <a href="https://en.wikipedia.org/wiki/Module:String_count" class="extiw" title="en:Module:String count">en:Module:String_count</a> importiert</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="de">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Version vom 25. März 2016, 13:08 Uhr</td>
</tr><tr><td colspan="2" class="diff-notice" lang="de"><div class="mw-diff-empty">(kein Unterschied)</div>
</td></tr></table>
Krd
https://de.wikipedia.org/w/index.php?title=Modul:String_count&diff=152847038&oldid=prev
Mr. Stradivarius: replace the match as it is found - perhaps this will use up less memory?
2015-03-06T02:19:25Z
<p>replace the match as it is found - perhaps this will use up less memory?</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 6. März 2015, 04:19 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 41:</td>
<td colspan="2" class="diff-lineno">Zeile 41:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Find the count</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Find the count</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local temp, count = mw.ustring.gsub(text, pattern, '')</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local temp, count = mw.ustring.gsub(text, pattern, '<ins style="font-weight: bold; text-decoration: none;">%0</ins>')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return count</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return count</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
</tr>
</table>
Mr. Stradivarius
https://de.wikipedia.org/w/index.php?title=Modul:String_count&diff=152847037&oldid=prev
Mr. Stradivarius: create string-counting module based on Module:User:Mr. Stradivarius/String count with additional error checks
2015-03-06T02:17:29Z
<p>create string-counting module based on <a href="/w/index.php?title=Modul:User:Mr._Stradivarius/String_count&action=edit&redlink=1" class="new" title="Modul:User:Mr. Stradivarius/String count (Seite nicht vorhanden)">Module:User:Mr. Stradivarius/String count</a> with additional error checks</p>
<p><b>Neue Seite</b></p><div>-- This module counts the number of times a string appears on a given page.<br />
<br />
local yesno = require('Module:Yesno')<br />
<br />
local p = {}<br />
<br />
local function escapePattern(s)<br />
-- Escape punctuation in a string so it can be used in a Lua pattern.<br />
s = s:gsub('%p', '%%%0')<br />
return s<br />
end<br />
<br />
function p._count(args)<br />
-- Get the page text, checking for common errors.<br />
if not args.page then<br />
error("no 'page' argument; please provide the name of the page you " ..<br />
"wish to count strings in", 2)<br />
end<br />
local title = mw.title.new(args.page)<br />
if not title then<br />
error(string.format(<br />
"'%s' is not a valid page name; check for invalid characters",<br />
args.page<br />
), 2)<br />
end<br />
local text = title:getContent()<br />
if not text then<br />
error(string.format(<br />
"could not get the content of page '%s'; check that it exists",<br />
title.prefixedText<br />
), 2)<br />
end<br />
<br />
-- Get the pattern<br />
local pattern = args.search<br />
if not pattern then<br />
error("no 'search' argument; please provide the string you wish to search for", 2)<br />
elseif yesno(args.plain) ~= false then<br />
pattern = escapePattern(pattern)<br />
end<br />
<br />
-- Find the count<br />
local temp, count = mw.ustring.gsub(text, pattern, '')<br />
return count<br />
end<br />
<br />
function p.count(frame)<br />
local args = require('Module:Arguments').getArgs(frame, {<br />
wrappers = 'Template:String count'<br />
})<br />
return p._count(args)<br />
end<br />
<br />
return p</div>
Mr. Stradivarius