grep - extract lines matching a regular expression pattern
(filename) (expression) grep -> [(line1) (line2) ...]
[(string1) (string2) ...] (expression) grep -> [(match1) (match2) ...]
[(hello) (world)] (^hell) grep -> [(hello)]
[(hello) (world)] (not in here) grep -> []
[(hello) (world)] () grep -> [(hello) (world)]
statusdict /prgdocdir get (LICENSE) joinpath (http) grep -> [(or visit https://www.nest-simulator.org)]
"grep" is similar to the Unix command "grep".
It performs a regular expression match, either on the lines of a
file, or on the strings in an array of strings. A valid regular
expression must be passed as a string as second argument.
"grep" returns an array of matching lines or strings. It returns the
full lines or strings that matched. If not match was found, the
empty array is returned.
(filename) - name of the file to search for the pattern
[(string1) ...] - array of strings to search for the pattern
[(match1) ...] - result: array of matching strings
By default, "grep" uses extended regular expressions and performs
case sensitive matching on the single lines or strings. This
behaviour can be customized via the "SetOptions" command.
"grep" has the following options that can be set via the
"SetOptions" command:
/flags_regcomp (integer) - flags passed to the "regcomp" command.
Must be the logical AND of any of
regexdict::REG_{EXTENDED,ICASE,NOSUB,NEWLINE}.
Default: REG_EXTENDED
/flags_regexec (integer) - flags passed to the "regexec" command.
Must be the logical AND of any of
regexdict::REG_{NOTBOL,NOTEOL}.
Default: 0
Please read the Unix manpage for "regcomp" for explanation of these
flags.
To perform case insensitive matches, add regexdict::REG_ICASE to
/flags_regcomp.
Raises /InvalidRegexError if the expression string is not a valid
regular expression.
standard SLI
Unix manpage for "regcomp"
R Kupper
23-jul-2008
/var/www/debian/nest/nest-simulator-2.20.0/lib/sli/regexp.sli