Ali Çehreli wrote: > Meanwhile, can you try the following template which works at least for > the reduced code: > > import std.range; > > auto foo(S)(S text) > if (isSomeString!S) { > import std.regex; > static auto inlineRE = ctRegex!`\$\(ta (.*?)\)`; > return text.replaceAll!(m => textAttr(m[1]))(inlineRE); > }
Well I didn't think isSomeString was appropriate since it also allows wstring-s and dstring-s which I'm not sure my other functions with work well with, but the following worked nicely for me: thank you! auto applyTextAttr(T)(T text) if (is(T: const(char)[])) { import std.regex; static auto inlineRE = ctRegex!`\$\(ta (.*?)\)`; return text.replaceAll!(m => textAttr(m[1]))(inlineRE); } -- Shriramana Sharma, Penguin #395953