Standard Module regsub

regsub This module defines a number of functions useful for working with regular expressions (see built-in module regex).


\begin{funcdesc}{sub}{pat\, repl\, str}
Replace the first occurrence of pattern ...
...ces
\samp{\e \var{digit}} to subpatterns and escaped backslashes.
\end{funcdesc}


\begin{funcdesc}{gsub}{pat\, repl\, str}
Replace all (non-overlapping) occurrenc...
...ch, so e.g.
\code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}.
\end{funcdesc}


\begin{funcdesc}{split}{str\, pat}
Split the string \var{str} in fields separate...
...e{['a', 'b']} and
\code{split('abc', '')} returns \code{['abc']}.
\end{funcdesc}