https://github.com/mveety/esmglob
Globbing utility based on my fork of es
https://github.com/mveety/esmglob
globbing language scripting shell terminal
Last synced: 8 months ago
JSON representation
Globbing utility based on my fork of es
- Host: GitHub
- URL: https://github.com/mveety/esmglob
- Owner: mveety
- License: bsd-3-clause
- Created: 2025-01-25T06:07:49.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-28T06:20:32.000Z (9 months ago)
- Last Synced: 2025-01-28T06:28:03.711Z (9 months ago)
- Topics: globbing, language, scripting, shell, terminal
- Language: Zig
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
es-mveety extended globbing
Basic Syntax:
[match pattern]![filter pattern]
Globs take the input set and matches it against the match pattern,
then it takes the match set and removes all elements that match the
filter pattern. Either the match or filter pattern can be omitted and
an empty pattern (ie an empty string) matches nothing.Patterns are similar to standard POSIX globs with some additions and
changes:Character classes:
match sets: (pattern|pattern|...)
These match against any pattern in the set. The patterns can
be any valid pattern.class match: [chars or range] ex: [a-z] or [A-Z] or [abcd]
These match against any single character in the range. They
can be inverted by beginning the match with ~ (ie [~ab]).
valid ranges are between a-Z and 0-9.wildcards: *, ?, ?n, ?
match as many chars as possible, one, n, or between min and maxexpansion macro: %string or %string (ie %[a-zA-Z]<3-5>)
The expansion macro expands to a match set containing the string
repeated length or min to max times:
ie: %a<3-5> is the same as (aaa|aaaa|aaaaa)matches all c and zig source files in this project:
from the root:
(|*/)*.(c|h|zig)
match all of es's sources in es-mveety:
(|libraries/)*.(c|h|y|es)!libinstall*
this will match all .c .y .h and .es files but removes
anything that matches libinstall* from the results.
match all files with names of 3 to 6 letters and an extension of 3 chars:
%[a-Z]<3-6>.?3
match a string made of 50 to 100 = signs that starts with a 1 to 6 digit
number
%[0-9]<1-6>%=<50-100>see also: https://github.com/mveety/es