<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AUser%3AMr._Stradivarius%2FString_count</id>
	<title>Module:User:Mr. Stradivarius/String count - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AUser%3AMr._Stradivarius%2FString_count"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:User:Mr._Stradivarius/String_count&amp;action=history"/>
	<updated>2026-04-23T04:36:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:User:Mr._Stradivarius/String_count&amp;diff=23778071&amp;oldid=prev</id>
		<title>imported&gt;Mr. Stradivarius: create a simple string count module</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:User:Mr._Stradivarius/String_count&amp;diff=23778071&amp;oldid=prev"/>
		<updated>2015-02-22T03:44:32Z</updated>

		<summary type="html">&lt;p&gt;create a simple string count module&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module counts the number of times a string appears on a given page.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function escapePattern(s)&lt;br /&gt;
	-- Escape punctuation in a string so it can be used in a Lua pattern.&lt;br /&gt;
	s = s:gsub(&amp;#039;%p&amp;#039;, &amp;#039;%%%0&amp;#039;)&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.count(frame)&lt;br /&gt;
	local text = mw.title.new(frame.args.page):getContent()&lt;br /&gt;
	local pattern = escapePattern(frame.args.search)&lt;br /&gt;
	local temp, count = mw.ustring.gsub(text, pattern, &amp;#039;&amp;#039;)&lt;br /&gt;
	return count&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>