- DocumentID: match
  Title: >+
    `match`
  CategoryID: commands
  Summary: >-
    Match an exact value in an array
  Description: |-
    `match` takes input from STDIN and returns any array items / lines which
    contain an exact match of the parameters supplied.

    When multiple parameters are supplied they are concatenated into the search
    string and white space delimited. eg all three of the below are the same:
    
    ```
    match "a b c"
    match a\sb\sc
    match a b c
    match a    b    c
    ```

    If you want to return everything except the search string then use `!match`
  Usage: |-
    Match every occurrence of search string

    ```
    <stdin> -> match search string -> <stdout>
    ```

    Match everything except search string

    ```
    <stdin> -> !match search string -> <stdout>
    ```
  Examples: |-
    Match **Wed**

    ```
    » ja: [Monday..Friday] -> match Wed
    [
        "Wednesday"
    ]
    ```

    Match everything except **Wed**

    ```
    » ja: [Monday..Friday] -> !match Wed
    [
        "Monday",
        "Tuesday",
        "Thursday",
        "Friday"
    ] 
    ```
  Flags:
  Detail: |-
    `match` is data-type aware so will work against lists or arrays of whichever
    Murex data-type is passed to it via STDIN and return the output in the
    same data-type.
  Synonyms:
  - match
  - "!match"
  - list.string
  Related:
  - a
  - ja
  - ta
  - count
  - 2darray
  - append
  - prepend
  - suffix
  - prefix
  - jsplit
  - msort
  - pretty
  - map
  - regexp



- DocumentID: regexp
  Title: >+
    `regexp`
  CategoryID: commands
  Summary: >-
    Regexp tools for arrays / lists of strings
  Description: |-
    `regexp` provides a few tools for text matching and manipulation against an
    array or list of strings - thus `regexp` is Murex data-type aware.
  Usage: |-
    ```
    <stdin> -> regexp expression -> <stdout>
    ```
  Examples: |-
    ### Find elements

    ```
    » ja: [monday..sunday] -> regexp 'f/^([a-z]{3})day/'
    [
        "mon",
        "fri",
        "sun"
    ]
    ```
    
    This returns only 3 days because only 3 days match the expression (where
    the days have to be 6 characters long) and then it only returns the first 3
    characters because those are inside the parenthesis.

    ### Match elements

    Elements containing

    ```
    » ja: [monday..sunday] -> regexp 'm/(mon|fri|sun)day/'
    [
        "monday",
        "friday",
        "sunday"
    ]
    ```

    Elements excluding

    ```
    » ja: [monday..sunday] -> !regexp 'm/(mon|fri|sun)day/'
    [
        "tuesday",
        "wednesday",
        "thursday",
        "saturday"
    ]
    ```

    ### Substitute expression

    ```
    » ja: [monday..sunday] -> regexp 's/day/night/'
    [
        "monnight",
        "tuesnight",
        "wednesnight",
        "thursnight",
        "frinight",
        "saturnight",
        "sunnight"
    ]
    ```
  Flags:
    f:
      output found expressions
      (doesn't support bang prefix)
    m:
      output elements that match expression
      (supports bang prefix)
    s:
      output all elements - substituting elements that match expression
      (doesn't support bang prefix)
  Detail: |-
    `regexp` is data-type aware so will work against lists or arrays of whichever
    Murex data-type is passed to it via STDIN and return the output in the
    same data-type.
  Synonyms:
  - regexp
  - "!regexp"
  - list.regex
  Related:
  - a
  - ja
  - ta
  - count
  - 2darray
  - append
  - prepend
  - suffix
  - prefix
  - jsplit
  - msort
  - pretty
  - map
  - match
