#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)[\s]+<\/coordinates>[\s\S]+?<coordinates>[\s]+"
Local $sString = "<?xml version="1.0" encoding="UTF-8"?>" & @CRLF & _
"<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">" & @CRLF & _
"<Document>" & @CRLF & _
" <name>Example.kml</name>" & @CRLF & _
" <Style id="s_ylw-pushpin_hl">" & @CRLF & _
" <IconStyle>" & @CRLF & _
" <scale>1.3</scale>" & @CRLF & _
" <Icon>" & @CRLF & _
" <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>" & @CRLF & _
" </Icon>" & @CRLF & _
" <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>" & @CRLF & _
" </IconStyle>" & @CRLF & _
" <LineStyle>" & @CRLF & _
" <color>ffff00ff</color>" & @CRLF & _
" <width>4</width>" & @CRLF & _
" </LineStyle>" & @CRLF & _
" </Style>" & @CRLF & _
" <StyleMap id="m_ylw-pushpin">" & @CRLF & _
" <Pair>" & @CRLF & _
" <key>normal</key>" & @CRLF & _
" <styleUrl>#s_ylw-pushpin</styleUrl>" & @CRLF & _
" </Pair>" & @CRLF & _
" <Pair>" & @CRLF & _
" <key>highlight</key>" & @CRLF & _
" <styleUrl>#s_ylw-pushpin_hl</styleUrl>" & @CRLF & _
" </Pair>" & @CRLF & _
" </StyleMap>" & @CRLF & _
" <Style id="s_ylw-pushpin">" & @CRLF & _
" <IconStyle>" & @CRLF & _
" <scale>1.1</scale>" & @CRLF & _
" <Icon>" & @CRLF & _
" <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>" & @CRLF & _
" </Icon>" & @CRLF & _
" <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>" & @CRLF & _
" </IconStyle>" & @CRLF & _
" <LineStyle>" & @CRLF & _
" <color>ffff00ff</color>" & @CRLF & _
" <width>4</width>" & @CRLF & _
" </LineStyle>" & @CRLF & _
" </Style>" & @CRLF & _
" <Folder>" & @CRLF & _
" <name>Example</name>" & @CRLF & _
" <open>1</open>" & @CRLF & _
" <Placemark>" & @CRLF & _
" <name>Untitled Path</name>" & @CRLF & _
" <styleUrl>#m_ylw-pushpin</styleUrl>" & @CRLF & _
" <LineString>" & @CRLF & _
" <tessellate>1</tessellate>" & @CRLF & _
" <coordinates>" & @CRLF & _
" 1.010794386877401,44.51240983736842,0 0.6286744887979312,47.46969863211312,0 4.198175193521713,47.66272708685459,0 4.47650525274385,45.32855385904715,0 " & @CRLF & _
" </coordinates>" & @CRLF & _
" </LineString>" & @CRLF & _
" </Placemark>" & @CRLF & _
" <Placemark>" & @CRLF & _
" <name>Untitled Path</name>" & @CRLF & _
" <styleUrl>#m_ylw-pushpin</styleUrl>" & @CRLF & _
" <LineString>" & @CRLF & _
" <tessellate>1</tessellate>" & @CRLF & _
" <coordinates>" & @CRLF & _
" 8.904276108011693,51.53463622874661,0 9.185337211508118,53.24757135457648,0 12.82197202867711,52.85957127892767,0 9.326760498064647,50.5694391186729,0 " & @CRLF & _
" </coordinates>" & @CRLF & _
" </LineString>" & @CRLF & _
" </Placemark>" & @CRLF & _
" <Placemark>" & @CRLF & _
" <name>Untitled Path</name>" & @CRLF & _
" <styleUrl>#m_ylw-pushpin</styleUrl>" & @CRLF & _
" <LineString>" & @CRLF & _
" <tessellate>1</tessellate>" & @CRLF & _
" <coordinates>" & @CRLF & _
" -0.8457721243506866,53.25357789001806,0 -2.495344342945436,52.51894778278026,0 -1.832838168564855,51.68947925151446,0 -0.004852378987588724,51.90053296811562,0 " & @CRLF & _
" </coordinates>" & @CRLF & _
" </LineString>" & @CRLF & _
" </Placemark>" & @CRLF & _
" </Folder>" & @CRLF & _
"</Document>" & @CRLF & _
"</kml>" & @CRLF & _
""
Local $sSubst = " "
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm