@tempots/std
mapRegExp() function
Map the function f
on each occurance matched by the pattern.
Signature:
mapRegExp: (subject: string, pattern: RegExp, f: (...s: string[]) => string) => string
Parameters
Parameter |
Type |
Description |
---|---|---|
subject |
string |
The string to search. |
pattern |
RegExp |
The pattern to match. |
f |
(...s: string[]) => string |
The function to apply to each match. |
Returns: string