Function parseStringUnixExpression

  • Parses given expression or undefined if invalid.

    Example

    parseStringUnixExpression("1 1 1 1 1"); // ["1", "1", "1", "1", "1"]
    parseStringUnixExpression(" 1 1 1 1 1 "); // ["1", "1", "1", "1", "1"]
    parseStringUnixExpression("1 1 1 1 1 1"); // undefined
    parseStringUnixExpression("1 1 1 1"); // undefined

    Returns

    An array of 5 elements or undefined if invalid.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | readonly [string, string, string, string, string]