murex Shell Docs

Command Reference: rx

Regexp pattern matching for file system objects (eg '.*.txt')

Description

Returns a list of files and directories that match a regexp pattern.

Output is a JSON list.

Usage

rx: pattern -> <stdout>

!rx: pattern -> <stdout>

Examples

Inline regex file matching:

cat: @{ rx: '.*\.txt' }

Writing a list of files to disk:

rx: '.*\.go' -> > filelist.txt

Checking if files exist:

if { rx: somefiles.* } then {
    # files exist
}

Checking if files do not exist:

!if { rx: somefiles.* } then {
    # files do not exist
}

Return all files apart from text files:

!g: '\.txt$'

Detail

Traversing Directories

Unlike globbing (g) which can traverse directories (eg g: /path/*), rx is only designed to match file system objects in the current working directory.

rx uses Go (lang)'s standard regexp engine.

Inverse Matches

If you want to exclude any matches based on wildcards, rather than include them, then you can use the bang prefix. eg

» rx: READ*                                                                                                                                                              
[
    "README.html"
]

murex-dev» !rx: .*
Error in `!rx` (1,1): No data returned.

Synonyms

See Also

This 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 Thu May 26 22:49:43 UTC 2022 against commit 59e27bb59e27bb1013043fc4a940cf9a2767c63f31dad2c.

Current version is 2.8.2100 which has been verified against 15889 tests cases.