Standard Module regsub

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

Warning: these functions are not thread-safe.


\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\optional{\, maxsplit}}
Split the string \var{s...
...inder of the string is returned as the final
element of the list.
\end{funcdesc}


\begin{funcdesc}{splitx}{str\, pat\optional{\, maxsplit}}
Split the string \var{...
...'b']}. Otherwise, this function behaves the same
as \code{split}.
\end{funcdesc}


\begin{funcdesc}{capwords}{s\optional{\, pat}}
Capitalize words separated by opt...
... done by changing the first
character of each word to upper case.
\end{funcdesc}