strReplaceRegex

fnSeries strReplaceRegex(Series s, string pattern, string replacement, RegexScope replaceScope = RegexScope.ALL)

Replaces regex matches with replacement (ADR-2026-10-30-01): the pattern compiles once per call (Phobos std.regex, ECMAScript flavour, case-sensitive - no flags in v1); scope = ALL (default) replaces every match, FIRST only the first. The replacement uses std.regex's dollar syntax verbatim ($1, ${name}, `$$` for a literal `$`); unmatched groups substitute empty; zero-width matches advance per the engine (a x* pattern terminates); null strings stay null. The kernel is serial - parallel regex is a named future tuning item.

Parameters

sthe STRING Series
patternthe regex (compiled once)
replacementthe dollar-syntax replacement
scopereplace every match or the first only

Returns

the replaced STRING Series.

Throws

DataFrameException on an invalid pattern or a replacement

reference the engine rejects, with the pattern in the message.