Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


make/functions/text (593 bytes)

1 # subst, patsubst, strip, findstring: text functions
2 #subst FROM,TO,TEXT # TEXT is the thing being operated against
3 #patsubst PATTERN,REPLACEMENT,TEXT # pattern can be %.c for example
4 #strip STRING # leading and trailing, good in conditionals
5 #findstring FIND,IN # returns empty string of the FIND
6 #filter PATTERN....[PATTERN],TEXT # all matches
7 #filter-out PATTERN....[PATTERN],TEXT # all non-matches
8 #sort LIST # space separated
9 #wordlist S,E,LIST # items from 1-based index S to E in LIST
10 #words TEXT # number of words in text
11 #firstword LIST # first one
12 #lastword LIST # last one
13 
14 $(<++>)