Ad Widget

Collapse

Z 3.4.6, preprocessing, regex

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anth(0)ny
    Member
    • Jul 2015
    • 42

    #1

    Z 3.4.6, preprocessing, regex

    Hello!

    I have a problem with item's data and preprocessing regex.

    Main item: telnet agent with 2 step-by-step commands. 2 entered requests return formatted multistring xml (text) with few garbage strings (echo of entered commands).

    Dependent items: gets data from main item via xpath request
    Data: extract from main item - various types (text, numeric, etc)

    At request's result I get 2 similar xml blocks of data and i need to ignore the 1st ocurrence (1st block) and place data to item from 2nd only, because 1st is useless and MUST be ignored.

    Block's tags:

    Code:
    <RESPONSE VERSION="L100"> ... </RESPONSE>
    My problem: i always get empty data at main item if i try to use regexp preprocessing. Main item is supported, but data always is empty.

    Can anybody help with CORRECT preprocessing regexp, please?

    I try to use this schema:

    1. Main item get raw text data with xml blocks and try to extract a 2nd ocurrence with this regexp:

    Code:
    (?:<R((?:.*?\r?\n?)*)E>)
    Output to get 2nd ocurrence: \2
    2. All dependent items extract data from main item via xpath requests, like this:

    Code:
    /RESPONSE[@VERSION="L100"]/OBJECT[1]//PROPERTY[@name="virtual-disk-serial"]/text()
    
    /RESPONSE[@VERSION="L100"]/OBJECT[1]//PROPERTY[@name="health-numeric"]/text()
    
    etc
    Full responce xml code and current experimental regex is here: https://regex101.com/r/I2ehOc/3

    Thank you.
    Last edited by Anth(0)ny; 28-02-2018, 10:43.
Working...