Help in regex with variable

Discussion in 'Questions' started by twaccou, Aug 10, 2019.

  1. twaccou

    twaccou Новичок

    Joined:
    Aug 10, 2019
    Messages:
    4
    Likes Received:
    0
    Hello
    I created a project and want to scrap two pieces of text from two website i can't figure out how to deal with regex to find these text.
    First one:
    title="Women">305.4</a></div>
    here Women is a variable from my list can be any other word. and i want to scrap the number next to it (305.4) this number will change with each variable.
    so i think the regex maybe word before: title="variable"> word after:</a> but i cant write it in regex designer.

    The second one :maybe will be more clear with an image . i want to scrap ( HQ1206) the text next to the highest number ( 88 ) and after my variable (305.4).

    [​IMG]

    and the source code
    [​IMG]

    your help will be very appreciated . attached is htm source code for both websites
     

    Attached Files:

  2. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    14,778
    Likes Received:
    3,623
  3. twaccou

    twaccou Новичок

    Joined:
    Aug 10, 2019
    Messages:
    4
    Likes Received:
    0
    Thx for replying i already read this article and used the regex tester. The problem is the variable can't be inserted in the regex tester
     
  4. awzse00

    awzse00 Client

    Joined:
    Mar 16, 2013
    Messages:
    166
    Likes Received:
    12
    You can't insert the variable per day, but you can parse the content of the variable. I hope i'm making sense here.
     
  5. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    14,778
    Likes Received:
    3,623
    Yes, can't be inserted in tester, but if you replace your keyword with variable in reg expression, it will work in action block.
     
  6. twaccou

    twaccou Новичок

    Joined:
    Aug 10, 2019
    Messages:
    4
    Likes Received:
    0
    could you please give an example on how regex structure with variable
     
  7. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    14,778
    Likes Received:
    3,623
    Just like this:
    \w+Woman\d+
    \w+{-Variable.Keyword-}\d+
    variable macro don't work in regex tester, but will work in Textprocessing>Regex action block.
     
  8. twaccou

    twaccou Новичок

    Joined:
    Aug 10, 2019
    Messages:
    4
    Likes Received:
    0
    Thank you. I am really appreciate your help
     

Пользователи просматривающие тему (Пользователей: 0, Гостей: 0)