lispdoc - results for replace |
(replace sequence1 sequence2 &rest args &key (start1 0) (end1 nil) (start2 0) (end2 nil)) | Function: The target sequence is destructively modified by copying successive elements into it from the source sequence.
|
Example:(defun parse-name (name) (let ((name (subseq name 21))) (declare (type simple-string name)) (if (search name "SB!" :end1 3) (replace name "SB-" :end1 3) name))) | Mentioned in: CLtL2 - 14.1. Simple Sequence Functions CLtL2 - 14.3. Modifying Sequences CLtL2 - 7.2. Generalized Variables HyperSpec - Function REPLACE Successful Lisp - chapter13 |
(ql-util:replace-file from to) | Function: Like RENAME-FILE, but deletes TO if it exists, first.
|
(cl-ppcre:regex-replace regex target-string replacement &key (start 0) (end (length target-string)) preserve-case simple-calls (element-type 'character)) | Function: Try to match TARGET-STRING between START and END against REGEX and replace the first match with REPLACEMENT. Two values are returned; the modified string, and T if REGEX matched or NIL otherwise. REPLACEMENT can be a string which may contain the special substrings "\&" for the whole match, "\`" for the part of TARGET-STRING before the match, "\'" for the part of TARGET-STRING after the match, "\N" or "\{N}" for the Nth register where N is a positive integer. REPLACEMENT can also be a function designator in which case the match will be replaced with the result of calling the function designated by REPLACEMENT with the arguments TARGET-STRING, START, END, MATCH-START, MATCH-END, REG-STARTS, and REG-ENDS. (REG-STARTS and REG-ENDS are arrays holding the start and end positions of matched registers or NIL - the meaning of the other arguments should be obvious.) Finally, REPLACEMENT can be a list where each element is a string, one of the symbols :MATCH, :BEFORE-MATCH, or :AFTER-MATCH - corresponding to "\&", "\`", and "\'" above -, an integer N - representing register (1+ N) -, or a function designator. If PRESERVE-CASE is true, the replacement will try to preserve the case (all upper case, all lower case, or capitalized) of the match. The result will always be a fresh string, even if REGEX doesn't match. ELEMENT-TYPE is the element type of the resulting string.
Compiler-Macro: Make sure that constant forms are compiled into scanners at compile time. |
(cl-ppcre:regex-replace-all regex target-string replacement &key (start 0) (end (length target-string)) preserve-case simple-calls (element-type 'character)) | Function: Try to match TARGET-STRING between START and END against REGEX and replace all matches with REPLACEMENT. Two values are returned; the modified string, and T if REGEX matched or NIL otherwise. REPLACEMENT can be a string which may contain the special substrings "\&" for the whole match, "\`" for the part of TARGET-STRING before the match, "\'" for the part of TARGET-STRING after the match, "\N" or "\{N}" for the Nth register where N is a positive integer. REPLACEMENT can also be a function designator in which case the match will be replaced with the result of calling the function designated by REPLACEMENT with the arguments TARGET-STRING, START, END, MATCH-START, MATCH-END, REG-STARTS, and REG-ENDS. (REG-STARTS and REG-ENDS are arrays holding the start and end positions of matched registers or NIL - the meaning of the other arguments should be obvious.) Finally, REPLACEMENT can be a list where each element is a string, one of the symbols :MATCH, :BEFORE-MATCH, or :AFTER-MATCH - corresponding to "\&", "\`", and "\'" above -, an integer N - representing register (1+ N) -, or a function designator. If PRESERVE-CASE is true, the replacement will try to preserve the case (all upper case, all lower case, or capitalized) of the match. The result will always be a fresh string, even if REGEX doesn't match. ELEMENT-TYPE is the element type of the resulting string.
Compiler-Macro: Make sure that constant forms are compiled into scanners at compile time. |
(rplaca cons x) | Function: Change the CAR of CONS to X and return the CONS.
|
| Mentioned in: CLtL2 - 15.1. Conses CLtL2 - 15.3. Alteration of List Structure CLtL2 - 15.5. Using Lists as Sets CLtL2 - 7.2. Generalized Variables HyperSpec - Function RPLACA, RPLACD On Lisp - When Nothing Else Will Do PCL - other structures Successful Lisp - closures | |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| By Bill Moorier |