github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/match.md (about)

     1  # `match`
     2  
     3  > Match an exact value in an array
     4  
     5  ## Description
     6  
     7  `match` takes input from STDIN and returns any array items / lines which
     8  contain an exact match of the parameters supplied.
     9  
    10  When multiple parameters are supplied they are concatenated into the search
    11  string and white space delimited. eg all three of the below are the same:
    12  
    13  ```
    14  match "a b c"
    15  match a\sb\sc
    16  match a b c
    17  match a    b    c
    18  ```
    19  
    20  If you want to return everything except the search string then use `!match`
    21  
    22  ## Usage
    23  
    24  Match every occurrence of search string
    25  
    26  ```
    27  <stdin> -> match search string -> <stdout>
    28  ```
    29  
    30  Match everything except search string
    31  
    32  ```
    33  <stdin> -> !match search string -> <stdout>
    34  ```
    35  
    36  ## Examples
    37  
    38  Match **Wed**
    39  
    40  ```
    41  » ja [Monday..Friday] -> match Wed
    42  [
    43      "Wednesday"
    44  ]
    45  ```
    46  
    47  Match everything except **Wed**
    48  
    49  ```
    50  » ja [Monday..Friday] -> !match Wed
    51  [
    52      "Monday",
    53      "Tuesday",
    54      "Thursday",
    55      "Friday"
    56  ] 
    57  ```
    58  
    59  ## Detail
    60  
    61  `match` is data-type aware so will work against lists or arrays of whichever
    62  Murex data-type is passed to it via STDIN and return the output in the
    63  same data-type.
    64  
    65  ## Synonyms
    66  
    67  * `match`
    68  * `!match`
    69  * `list.string`
    70  
    71  
    72  ## See Also
    73  
    74  * [`2darray` ](../commands/2darray.md):
    75    Create a 2D JSON array from multiple input sources
    76  * [`a` (mkarray)](../commands/a.md):
    77    A sophisticated yet simple way to build an array or list
    78  * [`append`](../commands/append.md):
    79    Add data to the end of an array
    80  * [`count`](../commands/count.md):
    81    Count items in a map, list or array
    82  * [`ja` (mkarray)](../commands/ja.md):
    83    A sophisticated yet simply way to build a JSON array
    84  * [`jsplit` ](../commands/jsplit.md):
    85    Splits STDIN into a JSON array based on a regex parameter
    86  * [`map`](../commands/map.md):
    87    Creates a map from two data sources
    88  * [`msort`](../commands/msort.md):
    89    Sorts an array - data type agnostic
    90  * [`prefix`](../commands/prefix.md):
    91    Prefix a string to every item in a list
    92  * [`prepend`](../commands/prepend.md):
    93    Add data to the start of an array
    94  * [`pretty`](../commands/pretty.md):
    95    Prettifies JSON to make it human readable
    96  * [`regexp`](../commands/regexp.md):
    97    Regexp tools for arrays / lists of strings
    98  * [`suffix`](../commands/suffix.md):
    99    Prefix a string to every item in a list
   100  * [`ta` (mkarray)](../commands/ta.md):
   101    A sophisticated yet simple way to build an array of a user defined data-type
   102  
   103  <hr/>
   104  
   105  This document was generated from [builtins/core/lists/regexp_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/lists/regexp_doc.yaml).