StringTools
RegSubs
perform regular expression substitutions
Calling Sequence
Parameters
Description
Examples
RegSubs( env, text )
env
-
string = string; substitution to make
text
string; text to substitute into
The RegSubs(env,text) command replaces each occurrence of a substring matching the left-hand side of env with the right-hand side of env in the string text.
If no substring of text matches the left-hand side of env, then text is returned unchanged.
This procedure is closely related to StringTools[RegSub], but provides a more intuitive interface. The chief difference between the two is that RegSubs effects all relevant substitutions (serially), while StringTools[RegSub] performs a single substitution. Also, the left-hand side of env cannot match an empty substring of text. (An exception is raised in this case.)
All of the StringTools package commands treat strings as (null-terminated) sequences of -bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
See Also
Regular_Expressions
string
StringTools[RegMatch]
StringTools[RegSub]
StringTools[Substitute]
StringTools[SubstituteAll]
Download Help Document