Tue Jul 05, 2022 4:48 pm
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.



How to retrieve the 2nd matched text using PARSE

Comments and questions related to the Enterprise Control Language

Wed Dec 11, 2019 2:39 pm Change Time Zone

Hi

I have a Patten:
Code: Select all
    PATTERN IntBounds := Int OPT(Ws) Sep OPT(Ws) Int;
    PATTERN ReelBounds := Reel OPT(Ws) Sep OPT(Ws) Reel;
    PATTERN MinMax := OpenP OPT(Ws) (IntBounds | ReelBounds) OPT(Ws) CloseP;

I can retrieve the 1st of the numbers of the pairs of numbers using:
Code: Select all
MATCHTEXT(MinMax/IntBounds/Int)

or
Code: Select all
MATCHTEXT(MinMax/ReelBounds/Reel)


but how does MATCHTEXT retrieve the 2nd of the 'Int' or 'Reel' components of MinMax?
I expect I can re-structure the patters to individually isolate the separate numbers which can then be referenced directly, but this seems a bit of a hack.

Yours
Allan
Allan
 
Posts: 444
Joined: Sat Oct 01, 2011 7:26 pm

Wed Dec 11, 2019 2:43 pm Change Time Zone

Ah answered my own question:

Code: Select all
MATCHTEXT(MinMax/IntBounds/Int[2])
Allan
 
Posts: 444
Joined: Sat Oct 01, 2011 7:26 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron