Start a Conversation

Unsolved

This post is more than 5 years old

937

March 9th, 2012 04:00

What is the pattern to match a newline character in a multi-line string in ASL

I want to split the string line by line.  The problem is I cannot determine what the line delimiter is.  Also, a related question, what is the character group that matches eol?  I could not locate either of these answers in the ASL documentation.  If I have missed it, please point me to it.  Thanks in advance.

See my example code below.  Take NOTE to the line with the comment “// NEED PROPER PATTERN”

lines = list();

PARSE_MULTILINE_VAR(s){

    input=s;

    /* == Example input ==

    Alert Raised on: November 17, 2011 12:28 AM

    Job: 4544441

    Tree Type : Server

    Tree Name : ALL MASTER SERVERS

    Nodes : nbmaster1, foo, bar

    Job Policy:

    Client: nbmaster1

    Alert Policy: Hung_job_test_SL

    OpsCenter Server: nbvbr1

    */

    //do not collect leading whitespace

    rep(any(" \t\r\n"))?

    //get everything except the line terminator

    currentLine:rep(notany("\n"))  // NEED PROPER PATTERN

    //rest of the string.

    remainingLines:rep(char)? ..eol

} do {

    lines += currentLine;

    if (remainingLines != "") {

          PARSE_MULTILINE_VAR(remainingLines);

    }

}

21 Posts

April 5th, 2012 13:00

Hi Noel - have a look at this answer to a similar question: https://community.emc.com/message/375287#375287

27 Posts

September 13th, 2012 17:00

Hi Noel,

Realizing that you've posted this question 6 months ago, are you still looking for some help? if so, please let me know how I may help you.

Regards,

TJ

EMC Technical Support Engineer III,

VCP, EMCSA, EMCIE

No Events found!

Top