String functions
****************
To use the string functions in Elib you have to put the following
line into your elisp source file:
(require 'string)
The following string functions are provided with Elib.
`(string-replace-match regexp string newtext &optional literal global)'
This function tries to be a string near-equivalent to the elisp
function `replace-match'. It returns a string with the first text
matched by REGEXP in STRING replaced by NEWTEXT. If no match is
found, `nil' is returned. If optional argument GLOBAL is
non-`nil', all occurances matching REGEXP are replaced instead of
only the first one.
If optional argument LITERAL is non-`nil', then NEWTEXT is
inserted exactly as it is. If it is `nil' (which is the default),
then the character `\' is treated specially. If a `\' appears in
NEWTEXT, it can start any one of the following sequences:
`\&'
`\&' stands for the entire text being replaced.
`\N'
`\N' stands for the Nth subexpression in the original regexp.
Subexpressions are those expressions grouped inside of
`\(...\)'. N is a digit.
`\\'
`\\' stands for a single `\' in NEWTEXT.
Any other character after the <\> will just be copied into the
string.
`(string-split pattern string &optional limit)'
Split the string STRING on the regexp PATTERN and return a list of
the strings between the matches. If the optional numerical
argument LIMIT is >= 1, only the first LIMIT elements of the list
are returned.
For example, the call
(string-split "[ \t]+" "Elisp programming is fun.")
will return `("Elisp" "programming" "is" "fun.")', but the call
(string-split " " "Elisp programming is fun." 3)
will return `("Elisp" "programming" "is")'.