Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Frage zu "regex" (ist doch ganz schön komplex)

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Frage zu "regex" (ist doch ganz schön komplex)

    This topic has been deleted. Only users with topic management privileges can see it.
    • bahnuhr
      bahnuhr Forum Testing Most Active last edited by

      Na gut Rainer, dann halt parser.

      In parser hab ich folgendes eingegeben:
      3372acc6-0538-42a2-918b-edc422d16702-grafik.png

      Bei klick rechts auf bearbeiten, kommt:
      9be0f6f1-829b-440d-8458-54bbfeb7fb69-grafik.png

      Unten im Ergebnis (und somit auch im Objekt) steht nichts.

      Wenn ich nun diesen Text (in der Mitte) kopiere nach regex101 kommt:
      b9578b8f-c2a0-4775-97c1-2ef3228e6bfb-grafik.png

      Wie ersichtlich werden die einzelne Werte korrekt ausgelesen.
      Nur im Adapter parser kommt nichts.

      Für mich stellt sich die Frage:
      Warum klappt das auf der webseite regex101 aber nicht im Adapter parser ?

      Vielleicht kannst du das nachvollziehen und hast eine Idee für mich.

      Danke.

      Homoran 1 Reply Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

        @bahnuhr sagte in Frage zu "regex" (ist doch ganz schön komplex):

        Warum klappt das auf der webseite regex101 aber nicht im Adapter parser ?

        es gibt leider verschiedene Parser "treiber"
        Es funktioniert nicht immer bei regex101 und in dem Adapter.

        Leider habe ich ja die alte Version nicht mehr und kann es daher nicht selber testen, aber ich werde versuchen dir zu helfen

        EDIT: nimm mal die "...." aus der Klammer

        1 Reply Last reply Reply Quote 0
        • bahnuhr
          bahnuhr Forum Testing Most Active last edited by

          ... rausgenommen.

          2ff07b56-6781-4d73-8690-39dff91e616f-grafik.png

          keine Veränderung

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

            @bahnuhr
            nicht rausnehmen -> vor die Klammer
            Die Punkte stehen für Leerzeichen - das ist dann keine Number

            1 Reply Last reply Reply Quote 0
            • bahnuhr
              bahnuhr Forum Testing Most Active last edited by

              so?
              399ab27e-55ad-496a-a25f-d5032ff045b2-grafik.png

              Homoran 1 Reply Last reply Reply Quote 0
              • Homoran
                Homoran Global Moderator Administrators @bahnuhr last edited by

                @bahnuhr
                Ja 😞

                Kannst du mir mal den Quelltext schicken, dann versuche ich es mal

                1 Reply Last reply Reply Quote 0
                • bahnuhr
                  bahnuhr Forum Testing Most Active last edited by

                  na klar
                  bitte schön

                  <!DOCtype HTML PUBLIC "-//W3C//Dtd HTML 4.0 Transitional//EN">
                  <html>
                  <head>
                  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
                  <meta name="Generator" CONTENT="ChrisB">
                  <title>PV Webserver</title>
                  </head>
                  <body nof="(MB=(DefaultMasterborder, 65, 60, 150, 10), L=(HomeLayout, 700, 600))" bgcolor="#EAF7F7" text="#000000" link="#0033CC" vlink="#990099" alink="#FF0000" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
                  <form method="post" action="">
                  <table cellspacing="0" cellpadding="0" width="770" nof="ly">
                  <tr><td height="5"></td></tr>
                  <tr><td width="190" height="55"></td>
                  <td width="400">
                    <font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif" size="+3">
                    PIKO 5.5
                  <br><font size="+1">                 
                    PV_Mueller (255)
                  </font>
                  </font>
                  </td>
                  <td><img alt="Logo" height="42" width="130" src="KSE.gif"></td>
                  </tr>
                  </table>
                  
                  <font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif">
                  <table Border="0" width="100%"><tr>
                  <td width="150"></td>
                  <td> <hr> </td>
                  </tr></table>
                  <table cellspacing="0" cellpadding="0" width="770">
                  <tr><td></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td colspan="2">
                    <b>AC-Leistung</b></td>
                  <td>&nbsp</td>
                  <td>
                    <b>Energie</b></td></tr>
                  <tr><td height="10"></td></tr>
                  
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    aktuell</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    1665</td>
                  <td width="140">&nbsp W</td>
                  <td width="100">
                    Gesamtenergie</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    31661</td>
                  <td width="50">&nbsp kWh</td>
                  <td>&nbsp</td></tr>
                  <tr height="2"><td></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    &nbsp</td>
                  <td width="70" align="right">
                    &nbsp</td>
                  <td width="140">&nbsp</td>
                  <td width="100">
                    Tagesenergie</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    3.32</td>
                  <td width="50">&nbsp kWh</td>
                  <td>&nbsp</td></tr>
                  <tr height="5"><td></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    Status</td>
                  <td colspan="4">
                    Einspeisen MPP</td>
                  <td>&nbsp</td></tr>
                  <tr height="8"><td></td></tr>
                  <tr><td colspan="7">
                  <table align="top" width="100%"><tr>
                  <td width="182"></td>
                  <td><hr size="1"></font></td></tr>
                  <tr><td height="5"></td></tr></table>
                  </td></tr>
                  <tr>
                  <td width="190"></td>
                  <td colspan="2">
                    <b>PV-Generator</b></td>
                  <td width="140">&nbsp</td>
                  <td colspan="2">
                    <b>Ausgangsleistung</b></td>
                  <td width="30">&nbsp</td>
                  <td>&nbsp</td></tr>
                  <tr><td height="10"></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    <u>String 1</u></td>
                  <td width="70">&nbsp</td>
                  <td width="140">&nbsp</td>
                  <td width="95">
                    <u>L1</u></td>
                  <td width="70">&nbsp</td>
                  <td width="30">&nbsp</td>
                  <td>&nbsp</td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    595</td>
                  <td width="140">&nbsp V</td>
                  <td width="100">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    236</td>
                  <td width="30">&nbsp V</td>
                  <td>&nbsp</td></tr>
                  <tr height="2"><td></td></tr>
                  <tr valign="top" align="left">
                  <td width="190">&nbsp</td>
                  <td width="100">
                    Strom</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    1.61</td>
                  <td width="140">&nbsp A</td>
                  <td width="100">
                    Leistung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    560</td>
                  <td width="30">&nbsp W</td>
                  <td>&nbsp</td></tr>
                  <tr height="22"><td></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    <u>String 2</u></td>
                  <td width="70">&nbsp</td>
                  <td width="140">&nbsp</td>
                  <td width="100">
                    <u>L2</u></td>
                  <td width="70">&nbsp</td>
                  <td width="30">&nbsp</td>
                  <td>&nbsp</td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    594</td>
                  <td width="140">&nbsp V</td>
                  <td width="100">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    234</td>
                  <td width="30">&nbsp V</td>
                  <td>&nbsp</td></tr>
                  <tr height="2"><td></td></tr>
                  <tr valign="top" align="left">
                  <td width="190">&nbsp</td>
                  <td width="100">
                    Strom</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    1.29</td>
                  <td width="140">&nbsp A</td>
                  <td width="100">
                    Leistung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    549</td>
                  <td width="30">&nbsp W</td>
                  <td>&nbsp</td></tr>
                  <tr height="22"><td></td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    <u>String 3</u></td>
                  <td width="70">&nbsp</td>
                  <td width="140">&nbsp</td>
                  <td width="100">
                    <u>L3</u></td>
                  <td width="70">&nbsp</td>
                  <td width="30">&nbsp</td>
                  <td>&nbsp</td></tr>
                  <tr>
                  <td width="190"></td>
                  <td width="100">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    0</td>
                  <td width="140">&nbsp
                    V</td>
                  <td width="95">
                    Spannung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    236</td>
                  <td width="30">&nbsp V</td>
                  <td>&nbsp</td></tr>
                  <tr height="2"><td></td></tr>
                  <tr valign="top" align="left">
                  <td width="190">&nbsp</td>
                  <td width="95">
                    Strom</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    0.00</td>
                  <td width="140">&nbsp
                  A</td>
                  <td width="95">
                    Leistung</td>
                  <td width="70" align="right" bgcolor="#FFFFFF">
                    552</td>
                  <td width="30">&nbsp W</td>
                  <td>&nbsp</td></tr>
                  
                  <tr><td height="15"></td></tr>
                  <tr><td colspan="7">
                  <table align="top" width="100%">
                  <tr><td width="182"></td>
                  <td><hr size="1"></font></td>
                  </tr><tr><td height="5"></td></tr></table>
                  </td></tr></table>
                  <table cellspacing="0" cellpadding="0" width="770">
                  <tr><td width="190"></td>
                  <td><font face="Arial,Helvetica,Geneva,Sans-serif">
                  <b>RS485 Kommunikation</b></td></tr>
                  <tr><td height="8"></td></tr>
                  <tr><td width="190"></td>
                  <td><font face="Arial,Helvetica,Geneva,Sans-serif">
                  Wechselrichter&nbsp
                  <input type="Text" name="edWrNr" value="255" size="3" maxlength="3">
                  <input type="submit" value="Anzeigen/Aktualisieren">
                  </td></tr><tr><td height="10"></td></tr>
                  </table>
                  </td></tr></table></font>
                  
                  <hr>
                  <table cellspacing="0" cellpadding="0" width="770">
                  <tr><td height="5"></td></tr>
                  <tr><td width="190"></td>
                  <td width="330">
                  <font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif">
                  <a href="LogDaten.dat">Historie</a>
                  &nbsp &nbsp &nbsp
                  <a href="Info.fhtml">Infoseite</a></font></td>
                  <td align="right">
                  <font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif">
                  <a href="Solar2.fhtml">Einstellungen</a></font></td>
                  <td width="50"></td>
                  </tr></table></font>
                  </form>
                  </body>
                  </html>
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active last edited by

                    das war jetzt der Text den parser in dem "Kästchen" hatte.

                    Homoran 1 Reply Last reply Reply Quote 0
                    • Homoran
                      Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

                      @bahnuhr
                      Ja!

                      ich habe eine "Lösung"
                      weiß aber selber nicht warum:

                      #FFFFFF">[^\d]+([^<]+)
                      

                      EDIT: nochmal geändert - jetzt weiß ich auch warum es so klappt

                      1 Reply Last reply Reply Quote 1
                      • bahnuhr
                        bahnuhr Forum Testing Most Active last edited by

                        @Homoran sagte in Frage zu "regex" (ist doch ganz schön komplex):

                        #FFFFFF">[^\d]+([^<]+)

                        Danke, ich probiers aus.
                        Ist schon komisch das ganze.

                        @Homoran sagte in Frage zu "regex" (ist doch ganz schön komplex):

                        EDIT: nochmal geändert - jetzt weiß ich auch warum es so klappt

                        Sag doch auch mal wie.

                        P.S.
                        Ich probier dies dann auch mal in einem Script aus.

                        1 Reply Last reply Reply Quote 0
                        • bahnuhr
                          bahnuhr Forum Testing Most Active last edited by

                          Jaaaaaaaaa

                          Es klappt sowohl mit Parser als auch im Script.

                          Warum das so ist würde mich doch interessieren.
                          Für evtl. zukünftiges.

                          P.S.
                          Hast ein Bier gut !

                          Homoran 1 Reply Last reply Reply Quote 0
                          • Homoran
                            Homoran Global Moderator Administrators @bahnuhr last edited by

                            @bahnuhr sagte in Frage zu "regex" (ist doch ganz schön komplex):

                            Warum das so ist würde mich doch interessieren.

                            iobroker mag kein \n

                            bahnuhr 1 Reply Last reply Reply Quote 0
                            • bahnuhr
                              bahnuhr Forum Testing Most Active @Homoran last edited by

                              @Homoran sagte in Frage zu "regex" (ist doch ganz schön komplex):

                              iobroker mag kein \n

                              Muss man aber auch erst einmal wissen.

                              Man sitzt vor der Kiste und denkt das muss doch gehen. Sieht doch alles logisch aus.
                              Und probiert, probiert, probiert.

                              Aber nun, alles gut.

                              Nochmals Danke.

                              Homoran 1 Reply Last reply Reply Quote 0
                              • Homoran
                                Homoran Global Moderator Administrators @bahnuhr last edited by

                                @bahnuhr
                                und für die Werte mit Nachkommastellen nimmst du:

                                FF">[^\d]+([^<]+\.\d+)
                                

                                @bahnuhr sagte in Frage zu "regex" (ist doch ganz schön komplex):

                                Hast ein Bier gut !

                                Wenn ich mal wieder auf die Kuppe komme

                                bahnuhr 1 Reply Last reply Reply Quote 0
                                • bahnuhr
                                  bahnuhr Forum Testing Most Active @Homoran last edited by

                                  @Homoran sagte in Frage zu "regex" (ist doch ganz schön komplex):

                                  Wenn ich mal wieder auf die Kuppe komme

                                  Gerne, jederzeit.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  426
                                  Online

                                  31.9k
                                  Users

                                  80.2k
                                  Topics

                                  1.3m
                                  Posts

                                  javascript
                                  3
                                  25
                                  739
                                  Loading More Posts
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  Community
                                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                  The ioBroker Community 2014-2023
                                  logo