simple_format
Format string, expanding abbreviations in keys'.
def simple_format(
s: string,
keys: dict[str, str | Callable],
pattern: Pattern[str],
expand: string
) - > string
Format string, expanding abbreviations in keys'.
Parameters
| Name | Type | Description |
|---|---|---|
| s | string | The input string containing abbreviations or placeholders to be expanded. |
| keys | `dict[str, str | Callable]` |
| pattern | Pattern[str] | A compiled regular expression used to identify the placeholders within the input string; defaults to RE_FORMAT. |
| expand | string | The expansion string used on the match object to extract the specific key name from the matched pattern; defaults to the first capturing group. |
Returns
| Type | Description |
|---|---|
string | The formatted string with all matched patterns replaced by their corresponding values or function results from the keys dictionary. |