$delim (delim-flag, parse-spec) function


This function accepts two arguments. The first argument is a delimiter keyword, one of: space, comma, colon, semi, pipe, dash, amp, plus, pct, hash, sp-dash, punct, bquote, cef or eol. (The sp-dash delimiter is a space, followed by a hyphen character; the bquote delimiter takes a balanced (closing) quote mark as the delimiter.) The function executes the parse specification using a delimiter character other than the standard space character. (See the section on the description of delimiter options.)

Target string

Parse expression

Return value

A|B|C|D|E

$delim (pipe, $3)

C

User=test, Device=dev001

$delim (comma, $2)

device=dev001

User USR01|Device dev001|Code 0x0

$deli (space, device *)

dev001|code

Note

Return value includes pipe char because delim is a space.

User USR01|Device DEV001|Code 0x0

$delim (pipe,

device *)

dev001

Note

Only device name is returned, delimited by pipe.

 XXX=A1;YYY=A2

 

 

$delim (punct, $2)

A1 

Note

Second field, delimited by any punctuation.

 User: test001 – Location: dev001 – value: ABC

 

 $delim (dash, 2)

 

 location: dev001 

Note

Second field, delimited by dash character.

 A,B,C,D,E

$delim(pipe, $4)

No match. No pipe delimiters.

Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*