<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.andreas-duffner.de/index.php?action=history&amp;feed=atom&amp;title=Regex</id>
	<title>Regex - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.andreas-duffner.de/index.php?action=history&amp;feed=atom&amp;title=Regex"/>
	<link rel="alternate" type="text/html" href="http://wiki.andreas-duffner.de/index.php?title=Regex&amp;action=history"/>
	<updated>2026-04-07T20:17:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>http://wiki.andreas-duffner.de/index.php?title=Regex&amp;diff=714&amp;oldid=prev</id>
		<title>Andreas: Created page with &quot;=== non greedy === Imagine you have the following text:  &lt;nowiki&gt;&lt;br /&gt;&#039;Stupid ad&#039;&lt;br /&gt;&lt;br /&gt;Real content&lt;br /&gt;&lt;/nowiki&gt;  If you use the regular expression  &lt;nowiki&gt;&lt;br /&gt;&#039;St...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.andreas-duffner.de/index.php?title=Regex&amp;diff=714&amp;oldid=prev"/>
		<updated>2023-02-24T20:18:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== non greedy === Imagine you have the following text:  &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;Stupid ad&amp;#039;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Real content&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;  If you use the regular expression  &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;St...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== non greedy ===&lt;br /&gt;
Imagine you have the following text:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;Stupid ad&amp;#039;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Real content&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use the regular expression&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;Stupid.*&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
then you will match the complete text, not just the &amp;#039;Stupid ad&amp;#039;. That is because &amp;#039;.&amp;#039; is greedy. &lt;br /&gt;
If you want it to not be greedy, try:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;Stupid.*?&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should only match &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;#039;Stupid ad&amp;#039;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
because you are using a non greedy search.&lt;/div&gt;</summary>
		<author><name>Andreas</name></author>
	</entry>
</feed>