<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.bayernflora.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3ALead%2FSplitNumberV2</id>
	<title>Vorlage:Lead/SplitNumberV2 - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.bayernflora.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3ALead%2FSplitNumberV2"/>
	<link rel="alternate" type="text/html" href="https://www.bayernflora.de/index.php?title=Vorlage:Lead/SplitNumberV2&amp;action=history"/>
	<updated>2026-10-12T21:04:21Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Flora von Bayern</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.bayernflora.de/index.php?title=Vorlage:Lead/SplitNumberV2&amp;diff=255&amp;oldid=prev</id>
		<title>imported&gt;Iris Leininger: 1 Version</title>
		<link rel="alternate" type="text/html" href="https://www.bayernflora.de/index.php?title=Vorlage:Lead/SplitNumberV2&amp;diff=255&amp;oldid=prev"/>
		<updated>2013-10-23T11:24:13Z</updated>

		<summary type="html">&lt;p&gt;1 Version&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 23. Oktober 2013, 13:24 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>imported&gt;Iris Leininger</name></author>
	</entry>
	<entry>
		<id>https://www.bayernflora.de/index.php?title=Vorlage:Lead/SplitNumberV2&amp;diff=5202&amp;oldid=prev</id>
		<title>imported&gt;Gregor Hagedorn am 21. September 2012 um 18:18 Uhr</title>
		<link rel="alternate" type="text/html" href="https://www.bayernflora.de/index.php?title=Vorlage:Lead/SplitNumberV2&amp;diff=5202&amp;oldid=prev"/>
		<updated>2012-09-21T18:18:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;IMPORTANT: THIS TEMPLATE IS NOT USED, the algoritm is implemented directly into [[Template:Lead]].&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;However, IT SHOULD NOT BE DELETED. It is useful for reference and to test new enhancements!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This template splits the parts of a Lead identifier. Examples are: “12 (2)” or &amp;quot;1*&amp;quot; or &amp;quot;1-&amp;quot;. This lead identifier may combine:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;the couplet id common to all leads of a couplet “12”&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;the part identifying the alternative leads within a couplet:&amp;quot;*&amp;quot;”&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;and the &amp;quot;coming-from couplet or lead-id&amp;quot;, called the backlink: “(2)”&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The splitting is designed for the following cases:&lt;br /&gt;
* Number plus backlink in round parenthesis (&amp;quot;10 (2)&amp;quot;)&lt;br /&gt;
* Number plus characters used to distinguish multiple leads in a couplet (like &amp;quot;2, 2*, 2**&amp;quot;, &amp;quot;2, 2&amp;#039;, 2&amp;#039;&amp;#039;&amp;quot;, ): Return 2 + *, etc.&lt;br /&gt;
** Note: unformatted apostrophe is converted to formatted apostrophe&lt;br /&gt;
* Number plus hyphen or ndash, like &amp;quot;2, 2-&amp;quot; (in contrast to the previous SplitNumber version, this now works exactly like with *)!&lt;br /&gt;
** Note: hyphen is converted to n-dash&lt;br /&gt;
* Number plus certain letter (for couplets with MANY leads), like &amp;quot;2 a, 2 b, 2 c&amp;quot;): Return 2 + a, etc.&lt;br /&gt;
*: Note: in this case, a blank must be present between the number and the letter. &amp;quot;1b&amp;quot; will not work!&lt;br /&gt;
&lt;br /&gt;
It is intended to be used in combination with [[Template: Lead]].&lt;br /&gt;
&lt;br /&gt;
The present implementation returns a semicolon-separated list of &amp;quot;before backlink&amp;quot;, couplet id, alternative id and backlink.&lt;br /&gt;
&lt;br /&gt;
In contrast to Lead/SplitNumber (the first version) this no longer handles:&lt;br /&gt;
* the display issues of the &amp;quot;1-&amp;quot;-case, where in the first lead (&amp;quot;1&amp;quot;, &amp;quot;2&amp;quot; etc.) normally the &amp;quot;1&amp;quot;, &amp;quot;2&amp;quot; are shown, but in the second lead (&amp;quot;1-&amp;quot;, &amp;quot;2-&amp;quot; etc.) the number is REPLACED by the &amp;quot;-&amp;quot;, rather than normally both being shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==USAGE examples==&lt;br /&gt;
&lt;br /&gt;
* 123: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123 }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123 }}|$|2}}&amp;quot;; expected = &amp;quot;123 +&amp;quot;&lt;br /&gt;
* 123 (22): actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123 (22) }}|$|1}} + ({{#explode:{{Lead/SplitNumberV2 | 123 (22) }}|$|3}})&amp;quot;; expected = &amp;quot;123 + (22)&amp;quot; -- full list is: {{Lead/SplitNumberV2 | 123 (22) }}&lt;br /&gt;
* 123*: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123* }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123* }}|$|2}}&amp;quot;; expected = &amp;quot;123 + *&amp;quot;&lt;br /&gt;
* 123**: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123** }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123** }}|$|2}}&amp;quot;; expected = &amp;quot;123 + **&amp;quot;&lt;br /&gt;
* 123***: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123*** }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123*** }}|$|2}}&amp;quot;; expected = &amp;quot;123 + ***&amp;quot;&lt;br /&gt;
* 123-: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123- }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123- }}|$|2}}&amp;quot;; expected = &amp;quot;123 + –&amp;quot;&lt;br /&gt;
* 123&amp;#039;: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123&amp;#039; }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123&amp;#039; }}|$|2}}&amp;quot;; expected = &amp;quot;123 + ’&amp;quot;&lt;br /&gt;
* 123’’: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123’’ }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123’’ }}|$|2}}&amp;quot;; expected = &amp;quot;123 + ’’&amp;quot;&lt;br /&gt;
* 123 a: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123 a }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123 a }}|$|2}}&amp;quot;; expected = &amp;quot;123 + a&amp;quot;&lt;br /&gt;
* 123a: actual = &amp;quot;{{#explode:{{Lead/SplitNumberV2 | 123a }}|$|1}} + {{#explode:{{Lead/SplitNumberV2 | 123a }}|$|2}}&amp;quot;; expected = &amp;quot;123a + (EMPTY)&amp;quot; -- &amp;#039;&amp;#039;&amp;#039;It is known that this does not work without a blank!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Extra test with all parts returned: &amp;quot;{{Lead/SplitNumberV2 | 123* (2) }}&amp;quot; should result in:  &amp;quot;123*$123$*$2&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;DEBUG NOTE:&amp;#039;&amp;#039;&amp;#039; no longer handled in this template, needs to be done outside: SPECIAL HANDLING: lead number IS SUPPRESSED and the hyphen/dash swapped in. Note: Tried to replace hyphen with n-dash, plus the rest after it, but did not work:  &amp;lt;nowiki&amp;gt;{{#replace: {{#sub:{{#var: leadIDMain}} |{{#pos:{{#var: leadIDMain}}|-}} |-|&amp;amp;ndash;}} }}&amp;lt;/nowiki&amp;gt;  So very simple instead just output &amp;amp;ndash; rather than replacing!&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
[[Category:Single-access key templates]]&lt;br /&gt;
&amp;lt;!-- Notes on the first steps below:&lt;br /&gt;
1. Init variables, then overwrite (Do not structure as if/else, both branches may be executed!)&lt;br /&gt;
2. With mediawiki #pos then leadIDParenthesisPos is &amp;quot;&amp;quot; if not found (not 0)!&lt;br /&gt;
3. the input is normalized: unformatted apostrophe to formatted, hypen to n-dash, and * to &amp;amp;#42;&lt;br /&gt;
3b. The &amp;quot;*&amp;quot; is difficult to handle, because it is often rendered as a list element. A simple &amp;quot;{{#sub:x|{{#pos:x|*}}}}&amp;quot; fails, the * returned by sub is already rendered as list-bullet.  nowiki, *-through-template, replace-with-§-then-replace-back fail as well. Only html entity worked.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{&lt;br /&gt;
#vardefine: leadIDParenthesisPos|{{#pos:{{{1}}}|(}}}}{{&lt;br /&gt;
#vardefine: leadIDMain|{{#replace:{{#replace:{{#replace:{{{1}}}|-|–}}|&amp;#039;|’}}|*|&amp;amp;#42;}}}}{{&lt;br /&gt;
#vardefine: backlink|}}{{&lt;br /&gt;
#if: {{#var: leadIDParenthesisPos}}|{{&lt;br /&gt;
  #vardefine: backlink|{{Trim|{{#replace:{{#sub:{{#var: leadIDMain}}|{{#expr:{{#var: leadIDParenthesisPos}}+1 }}&amp;lt;!--end sub/repl/trim/vardef:--&amp;gt;}}|)|}} }}}}{{&lt;br /&gt;
  #vardefine: leadIDMain|{{Trim|1={{#sub:{{#var: leadIDMain}} | 0 |{{#var: leadIDParenthesisPos}} }} }}}}&lt;br /&gt;
}}&amp;lt;!-- // end if leadIDParenthesisPos.&lt;br /&gt;
&lt;br /&gt;
// Now split the leadIDMain into coupletID (=coupletID) and part2 (=alternativeID). First determine splitting position:&lt;br /&gt;
--&amp;gt;{{#vardefine: leadIDSplitPos|{{#pos:{{#var: leadIDMain}}|&amp;amp;#42;}}}}{{#if: {{#var: leadIDSplitPos}}|&amp;lt;!--nothing, &lt;br /&gt;
else:--&amp;gt;|{{#vardefine: leadIDSplitPos|{{#pos:{{#var: leadIDMain}}|–}}}}{{#if: {{#var: leadIDSplitPos}}|&amp;lt;!--nothing, &lt;br /&gt;
else:--&amp;gt;|{{#vardefine: leadIDSplitPos|{{#pos:{{#var: leadIDMain}}|’}}}}{{#if: {{#var: leadIDSplitPos}}|&amp;lt;!--nothing, &lt;br /&gt;
else:--&amp;gt;|{{#vardefine: leadIDSplitPos|{{#pos:{{#var: leadIDMain}}|&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;}}}}&amp;lt;!--&lt;br /&gt;
close 3x if: --&amp;gt;}}}}}}&amp;lt;!-- &lt;br /&gt;
// Now use leadIDSplitPos to split part 1 and part 2:&lt;br /&gt;
--&amp;gt;{{#vardefine: coupletID| {{#sub:{{#var: leadIDMain}}| 0 |{{#var: leadIDSplitPos}}&amp;lt;!--end sub+vardef:--&amp;gt;}}}}{{&lt;br /&gt;
     #vardefine: part2| {{#sub:{{#var: leadIDMain}}|{{#var: leadIDSplitPos}}}}}}{{&lt;br /&gt;
#var: leadIDMain}}${{#var: coupletID}}${{#var: part2}}${{#var: backlink}}&lt;/div&gt;</summary>
		<author><name>imported&gt;Gregor Hagedorn</name></author>
	</entry>
</feed>