David Moyer

Another custom function for text parsing

Discussion created by David Moyer on Oct 10, 2016
Latest reply on Nov 24, 2016 by David Moyer

Hi all,

This is just an update/improvement on a previous post.  I wanted to create a document because of the HUGE demand for this.

A recent example of usage:

$parsedURL =  ParseValueByBookends ( $resultHTML; "href=\""; 2; "\">" )

This would extract the second occurrence of a href url from the text.

Capture.PNG

Let(

  [

    posL = Position(text; leftSideTag; 1; occurrence);

    posR = Position(text; rightSideTag; posL + 1; 1);

    leftStart = posL + Length(leftSideTag)

  ];

  If(posL > 0 and posR > posL;

    Middle(text; leftStart; posR - leftStart);

    ""

  )

)

Outcomes