Regular Expressions 101

Placeholder resolving

3

Regular Expression
.NET 7.0 (C#)

@"
\${(\s*((?<rewriter>[^(\s]+)\s*\(\s*(?<key>[^()?\s}]+)\s*\)\s*)|(\s*(?<key>[^()?\s}]+)\s*))(\?(?<fallback>[^}]*))*}
"
gm

Description

.Net regular expression for resolving placeholders in the format of ${rewriter(multilevel:key)?fallback} (+ variations)

Submitted by anonymous - 8 months ago