User talk:Mm/Lightbox RegEx Error

Discussion page of User:Mm/Lightbox RegEx Error

Die Lightbox Extension produziert einen Fehler auf Special:NewPages

✿ Ich wäre sehr dankbar für hilfreiche Hinweise von RegEx-Hackern ✿


ohne Lightbox

<td>
<div class="gallerybox" style="width: 155px;">
<div class="thumb" style="padding: 30px 0; width: 150px;">
	<div style="margin-left: auto; margin-right: auto; width: 120px;">
		<a href="/medien/wiki/File:Projection_draft.jpg" class="image" title="Projection draft.jpg">
		<img alt="" src="/medien/wiki/images/thumb/Projection_draft.jpg/120px-Projection_draft.jpg" width="120" height="85" border="0" />
		</a>
	</div>
</div>
<div class="gallerytext">
	<a href="/medien/wiki/File:Projection_draft.jpg" title="File:Projection draft.jpg">Projection draft.jpg</a><br />
	<a href="/medien/wiki/index.php5?title=User:Petu3224&amp;action=edit&amp;redlink=1" class="new" title="User:Petu3224 (page does not exist)">Petu3224</a><br />
	<i>11:17, 6 May 2010</i><br />
	710,723 bytes<br />
</div>
</div>
</td>

mit Lightbox

<td>
<div class="gallerybox" style="width: 155px;">
<div class="thumb" style="padding: 30px 0; width: 150px;">
	<div style="margin-left: auto; margin-right: auto; width: 120px;">
		<a href="/medien/wiki/images/Projection_draft.jpg" class="image" rel="lightbox[gallery]" title="<a href="/medien/wiki/File:Projection_draft.jpg" title="File:Projection draft.jpg">Projection draft.jpg</a><br />
		<a href="/medien/wiki/index.php5?title=User:Petu3224&amp;action=edit&amp;redlink=1" class="new" title="User:Petu3224 (page does not exist)">Petu3224</a><br />
		<i>11:17, 6 May 2010</i><br />
		710,723 bytes" >
		<img alt="" src="/medien/wiki/images/thumb/Projection_draft.jpg/120px-Projection_draft.jpg" width="120" height="85" border="0" />
		</a>
	</div>
</div>
<div class="gallerytext">
	<a href="/medien/wiki/File:Projection_draft.jpg" title="File:Projection draft.jpg">Projection draft.jpg</a><br />
	<a href="/medien/wiki/index.php5?title=User:Petu3224&amp;action=edit&amp;redlink=1" class="new" title="User:Petu3224 (page does not exist)">Petu3224</a><br />
	<i>11:17, 6 May 2010</i><br />
	710,723 bytes</div>
</div>
</td>

Das Problem liegt anscheinend im RegEx Parser für "gallerytext"

$pattern = '/(<div\s*class="gallerybox".+?div\s*class="thumb".+?) # $1: div.gallerybox opening tag through href attribute, so we can keep it intact
	\s*href="[^"]+"\s*class="image"\s*                   # this is getting replaced
	title="([^"]+)"                                      # $2: link title attribute holds wiki name for the image
	([^>]*>.+?<div\s*class="gallerytext">)               # $3: end of open <a> through start of caption
	\s*(?:<p>\s*)?                                       #
	(.+?)                                                # $4: caption is raw HTML... (may choke if contains an ending div)
	(?:\s*(<\/p>|<br\s*\/?>))?\s*<\/div>                 #
	/sx';