regexp
Regexp tools for arrays / lists of strings
regexp
provides a few tools for text matching and manipulation against an array or list of strings - thus regexp
is murex data-type aware.
<stdin> -> regexp expression -> <stdout>
» 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.
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"
]
» ja: [monday..sunday] -> regexp 's/day/night/'
[
"monnight",
"tuesnight",
"wednesnight",
"thursnight",
"frinight",
"saturnight",
"sunnight"
]
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)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.
regexp
!regexp
list.regex
2darray
: Create a 2D JSON array from multiple input sourcesa
(mkarray): A sophisticated yet simple way to build an array or listappend
: Add data to the end of an arraycount
: Count items in a map, list or arrayja
(mkarray): A sophisticated yet simply way to build a JSON arrayjsplit
: Splits STDIN into a JSON array based on a regex parametermap
: Creates a map from two data sourcesmatch
: Match an exact value in an arraymsort
: Sorts an array - data type agnosticprefix
: Prefix a string to every item in a listprepend
: Add data to the start of an arraypretty
: Prettifies JSON to make it human readablesuffix
: Prefix a string to every item in a listta
(mkarray): A sophisticated yet simple way to build an array of a user defined data-typeThis site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Mon Feb 13 09:18:06 UTC 2023 against commit f339958f33995895c1d997efcdbb8408d2c8d45f8b5f934.
Current version is which has been verified against 13950 tests cases.