first off, I am not sure if this belongs into this part of the board. If not, feel free to move it to whereever it may belong.
I have a problem trying to get a working RegExp. To make it easier to understand what I want, here is an exerpt of the file I am parsing (German stuff inside, and I know it's a horrible code layout, it's not coded by me ):
Code: Select all
<tr>
<td class="time">14:44</td>
<td class="train"><a href="http://reiseauskunft.bahn.de/bin/traininfo.exe/dn/100770/150211/943078/437949/80?ld=9698&country=DEU&rt=1&date=30.12.10&time=14:44&station_evaId=8000050&station_type=dep&"><img src="/v/760/img/ec_ic_24x24.gif" class="middle" alt="" /></a></td><td class="train">
<a href="/bin/traininfo.exe/dn/100770/150211/943078/437949/80?ld=9698&country=DEU&rt=1&date=30.12.10&time=14:44&station_evaId=8000050&station_type=dep&">
IC 2329
</a>
</td>
<td class="route">
<span class="bold">
<a onclick="sHC(this, '', '8000298','00:48'); return false;" href="/bin/bhftafel.exe/dn?input=Passau Hbf%238000298&boardType=dep&time=00:48&productsFilter=01&start=yes">
Passau Hbf
</a>
</span>
<br />
Bremen Hbf
14:44
-
Osnabrück Hbf
15:35
-
Münster(Westf)Hbf
16:00
-
Dortmund Hbf
16:33
-
Hagen Hbf
16:55
-
Wuppertal Hbf
17:12
-
Solingen Hbf
17:25
-
Köln Hbf
17:46
-
Bonn Hbf
18:12
-
Koblenz Hbf
18:46
-
Mainz Hbf
19:38
-
Frankfurt(M) Flughafen Fernbf
19:59
-
Frankfurt(Main)Hbf
20:13
-
Hanau Hbf
20:33
-
Aschaffenburg Hbf
20:47
-
Würzburg Hbf
21:28
-
Nürnberg Hbf
22:26
-
Regensburg Hbf
23:37
-
Straubing
00:00
-
Plattling
00:15
-
Passau Hbf
00:48
</td>
<td class="platform">
<strong>7</strong><br />
</td>
<td class="ris">
<span><span style="color:#f00;">ca. 80 Minuten später</span></span>,<br/><span class="red">Grund: Verspätung aus vorheriger Fahrt</span></td>
</tr>
<tr>
<td class="time">15:17</td>
<td class="train"><a href="http://reiseauskunft.bahn.de/bin/traininfo.exe/dn/636507/854432/27498/198420/80?ld=9698&country=DEU&rt=1&date=30.12.10&time=15:17&station_evaId=8000050&station_type=dep&"><img src="/v/760/img/ec_ic_24x24.gif" class="middle" alt="" /></a></td><td class="train">
<a href="/bin/traininfo.exe/dn/636507/854432/27498/198420/80?ld=9698&country=DEU&rt=1&date=30.12.10&time=15:17&station_evaId=8000050&station_type=dep&">
IC 2322
</a>
</td>
<td class="route">
<span class="bold">
<a onclick="sHC(this, '', '8000199','17:21'); return false;" href="/bin/bhftafel.exe/dn?input=Kiel Hbf%238000199&boardType=dep&time=17:21&productsFilter=01&start=yes">
Kiel Hbf
</a>
</span>
<br />
Bremen Hbf
15:17
-
Hamburg-Harburg
16:00
-
Hamburg Hbf
16:12
-
Hamburg Dammtor (Halt entfällt)
16:18
-
Neumünster (Halt entfällt)
17:01
-
Kiel Hbf (Halt entfällt)
17:21
</td>
<td class="platform">
<strong>9</strong><br />
</td>
<td class="ris">
<span class="red">Fährt heute nur bis Hamburg Hbf</span><span style="padding-left:-5px;">,</span><br/><span><span style="color:#f00;">ca. 60 Minuten später</span></span>,<br/><span class="red">Grund: hohes Fahrgastaufkommen</span></td>
</tr>
For this, I wanted to use Lookaheads. So, the code to get the time of the first train of the list was:
Code: Select all
(?siU)<td class="time">.*(\d\d:\d\d).*</td>
Code: Select all
(?siU)<td class="time">.*(\d\d:\d\d)(?=.*Hamburg Hbf .*(?! .*</tr>))
Just to clarify: I am a complete RegExp newbie, I am coding Rainmeter stuff since yesterday, so there is a high chance that it is just a stupid little failure that I have in there, but I can't find it. I have tried too many variations to post them here, so the question is: What would be the correct RegExp to get the job done?
Thanks in Advance for your help.
malexmave