MATCH(1L)
π NAME π
okay bestie, this page is for match from SchilyΒ΄s USER COMMANDS β yes, thatβs MATCH(1L) in the house π
β and it searches for patterns in files. lowkey iconic.
β¨ SYNOPSIS β¨
match [ -option ] pattern [ file ... ]
π DESCRIPTION π
So match searches the named files β or standard input if you donβt give any filenames β for occurrences of the given pattern on each line. It accepts literal characters or special pattern matching characters. Every line that matches the pattern gets output on standard output. β¨
You can only specify one pattern string for each match, but bestie, you can construct an arbitrarily complex string. When you do not specify a file, match can be used as a filter to display desired lines. Standard in is used if no files are specified. fr fr.
π OPTIONS π
-not,-vβ prints all lines that do not match.-iβ ignore the case of letters.-mβ force not to use the magic mode.-wβ search for the pattern as a word.-xβ display only those lines which match exactly.-cβ display matching count for each file.-lβ display name of each file which matches.-sβ be silent, and indicate a match in the exit code.-hβ do not display filenames.-nβ precede matching lines with line number (with respect to the input file).-bβ precede matching lines with block number.
π¦ REGULAR EXPRESSIONS π¦
Hereβs the full list of all the pattern matching characters, bestie β no skips, no crumbs:
cβ an ordinary character (not one of the special characters discussed below) is a one character regular expression that matches that character.\cβ a backslash (\) followed by any special character is a one character regular expression that matches the special character itself. The special characters are:! # % * { } [ ] \ ? ^ $!β logical OR, as inmatch this!that!the_other. You may have to use{}for precedence grouping.#β a hash mark followed by any regular expression matches any number (including zero) occurrences of the regular expression.?β matches exactly any one character.W?matchesWa,Wb,Wc,W1,W2,W3...*β matches any number of any character.%β matches exactly nothing. It can be used in groups of ored patterns to specify that an empty alternative is possible.{}β curly brackets may be used to enclose patterns to specify a precedence grouping, and may be nested.{%!{test}}versionmatches the stringstestversionandversion.[string]β a non empty string of characters enclosed in square brackets is a one character regular expression that matches any one character in that string. If however the first character of the string is a circumflex (^), the one character expression matches any character which is not in the string. The^has this special meaning only if it occurs first in the string. The minus (-) may be used to indicate a range of consecutive ASCII characters; for example,[0-9]is equivalent to any one of the digits. The-loses itβs special meaning if it occurs first (after an initial^, if any) or last in the string. The right square bracket (]) and the backslash (\) must be quoted with a backslash if you want to use it within the string.^β matches the beginning of a line.$β matches the end of a line. (^*$matches any entire line)
π EXAMPLES π
No examples are listed in the original page. itβs giving mysterious. π«Ά
π FILES π
None.
π SEE ALSO π
π DIAGNOSTICS π
No diagnostics are listed in the original page.
π§ NOTES π§
Even if a match occurs more than once per line, the line is output only once. periodt.
Quote special pattern matching characters to prevent them from being expanded by the Command Interpreter.
π BUGS π
The length of the pattern is currently limited to 100 characters. π
This limit is reduced by 38 if the -w option is used.
okay thatβs the whole vibe β this page is MATCH(1L) from SchilyΒ΄s USER COMMANDS, written by Joerg Schilling, dated 15. Juli 1988. bye bestie! π
π¦ where this page comes from
- nixos 26.05: s-tar 1.6
- nixpkgs unstable: s-tar 1.6
- Copyright 1985-1997 J. Schilling
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms