【发布时间】:2020-06-16 23:51:02
【问题描述】:
我有以下字符串:
{At condition {0}, the value of {1} must be between {2} and {3}.}{{code{min <= 100}}}{{code{min}}}{0}{100}
如何在python中将任何类似的字符串转换为以下格式?
At condition `min <= 100`, the value of `min` must be between 0 and 100.
大括号中的数字应替换为相应的值。如果将值包装到{code{value}} 中,则应添加专用符号 ``。
【问题讨论】:
标签: python regex parsing format