Currently, I am using this regex pattern which is functional, but there is room for optimization. The pattern seems very "literal" and may be impacting the processing speed when using tokens. While it could potentially run faster with optimized tokens, the process is not very straightforward for beginners...
const pattern = /left\s:([-]{0,1}[0-9]{1,4})px;\stop:([0-9]{1,4})px;"\s\s\tonmouseover="updi\(event,'([0-9]{4}-[0-9]{2}-[0-9]{2})\s([0-9]{2}:[0-9]{2})\s([A-Z]{3,4})\s\((T[+]{1}\s[0-9]{1}:[0-9]{2}|T[+]{1}[0-9]{2,3}:[0-9]{2})\)<br>Distances: ([0-9]{1,4}\.[0-9]{1}nm)\/([0-9]{1,4}\.[0-9]{1}nm)<br><b>Wind:</b>\s([0-9]{1,3}°);\s([0-9]{1,2}\.[0-9]{1}\skt)\s\(<b>TWA\s([-]{0,1}[0-9]{1,3}°);</b><br><b>Heading:</b>\s([0-9]{1,3}°);<b>Sail:</b>\s([a-zA-Z]{2,4})<br><b>Boat\sSpeed:</b>\s([0-9]{1,3}\.[0-9]{2}\skts)/
The regex pattern extracts values that can be utilized later in the code, as shown in the following example:
<img src="img/dot.png" alt="" class="abs" style="z-index: 1; left :-4904px; top:2437px;"
onmouseover="updi(event,'2019-10-15 02:00 CEST (T+ 1:50)<br>Distances: 1271.8nm/447.1nm<br><b>Wind:</b> 295° 5.8 kt (<b>TWA 65°</b>)<br><b>Heading:</b> 230°<b>Sail:</b> Jib<br><b>Boat Speed:</b> 3.23 kts','220px')" onmouseout="cleari()"
onmousedown="show_wind(366);">
<img src="img/dot.png" alt="" class="abs" style="z-index: 1; left :49px; top:243px;"
onmouseover="updi(event,'2019-10-15 02:00 CET (T+363:50)<br>Distances: 1271.8nm/447.1nm<br><b>Wind:</b> 295° 5.8 kt (<b>TWA 65°</b>)<br><b>Heading:</b> 230°<b>Sail:</b> Jib<br><b>Boat Speed:</b> 3.23 kts','220px')" onmouseout="cleari()"
onmousedown="show_wind(366);">