diff --git a/strsync/strsync_playground.py b/strsync/strsync_playground.py index edd3837..27eaf44 100644 --- a/strsync/strsync_playground.py +++ b/strsync/strsync_playground.py @@ -38,6 +38,7 @@ %10c%5hc%5C%5lc The temp is %.*f %ss%lii +${replacement} %*.*s | %.3d | %lC | %s%%%02d''' cfmt='''\ @@ -49,8 +50,10 @@ (?:\.(?:\d+|\*))? # precision (?:h|l|ll|w|I|I32|I64)? # size [cCdiouxXeEfgGaAnpsSZ@] # type -) | # OR -%%) # literal "%%" +) # OR +| \$\{.+\} # replacement for property "%{appName}" +| %% # literal "%%" +) ''' for line in lines.splitlines(): diff --git a/strsync/strtrans.py b/strsync/strtrans.py index eb340be..08b37e5 100644 --- a/strsync/strtrans.py +++ b/strsync/strtrans.py @@ -13,8 +13,10 @@ (?:\.(?:\d+|\*))? # precision (?:h|l|ll|w|I|I32|I64)? # size [cCdiouxXeEfgGaAnpsSZ@] # type - ) | # OR - %%) # literal "%%" + ) # OR + | \$\{.+\} # replacement for property "%{appName}" + | %% # literal "%%" + ) ''' __LITERNAL_FORMAT_RE__ = re.compile(__LITERAL_REGEX__, flags=re.X)