$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 |
User USR01|Device DEV001|Code 0x0 | $delim (pipe, device *) | dev001 |
XXX=A1;YYY=A2
| $delim (punct, $2) | A1 |
User: test001 – Location: dev001 – value: ABC
| $delim (dash, 2)
| location: dev001 |
A,B,C,D,E | $delim(pipe, $4) | No match. No pipe delimiters. |
Related topic