Solved Problems with a conditional based on CELLID

Discussion in 'Tasker' started by mattress, Oct 7, 2019.

  1. mattress

    mattress New Member

    Joined:
    Mar 27, 2018
    Messages:
    17
    Likes Received:
    0
    So I'm recording Cell IDs into a variable, with a date and a new line, for some location stuff. It seems that I can't get any pattern matching working.

    $Homecells:
    CDMA:1234/10-7-19
    CDMA:5678/10-7-19
    CDMA:135/10-7-19
    CDMA:246/10-7-19

    The only time my IF %CELLID ~ %Homecells works is if CELLID matches the top entry. What am I missing?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,709
    Likes Received:
    736
    Hi! this seems to work for me :)
    Code (Text):
        Test (2)
            A1: Variable Set [ Name:%cells To:CDMA:1234/10-7-19
        CDMA:5678/10-7-19
        CDMA:135/10-7-19
        CDMA:246/10-7-19 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
            A2: Variable Set [ Name:%test To:CDMA:5678/10-7-19 Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
            A3: If [ %cells ~R (.|\n)*%test ?(.|\n)* ]
            A4: Flash [ Text:Matches! Long:Off ]
            A5: End If
       
    Hope this helps!
     
  3. mattress

    mattress New Member

    Joined:
    Mar 27, 2018
    Messages:
    17
    Likes Received:
    0
    Good Lord. Thank you! And thanks for the reminder of why I hate regex. I've no idea what that says. LOL
     
: tasker, cellid

Share This Page