(cl-ppcre:scan regex target-string &key start end real-start-pos
((real-start-pos *real-start-pos*) nil) (end (length target-string)) (start 0)) | Function: Searches TARGET-STRING from START to END and tries to match REGEX. On success returns four values - the start of the match, the end of the match, and two arrays denoting the beginnings and ends of register matches. On failure returns NIL. REGEX can be a string which will be parsed according to Perl syntax, a parse tree, or a pre-compiled scanner created by CREATE-SCANNER. TARGET-STRING will be coerced to a simple string if it isn't one already. The REAL-START-POS parameter should be ignored - it exists only for internal purposes.
Compiler-Macro: Make sure that constant forms are compiled into scanners at compile time.
|
| | |
| | |
(cl-ppcre:do-scans
(match-start match-end reg-starts reg-ends regex target-string &optional
result-form &key start end)
&body body &environment env) | Function: Iterates over TARGET-STRING and tries to match REGEX as often as possible evaluating BODY with MATCH-START, MATCH-END, REG-STARTS, and REG-ENDS bound to the four return values of each match in turn. After the last match, returns RESULT-FORM if provided or NIL otherwise. An implicit block named NIL surrounds DO-SCANS; RETURN may be used to terminate the loop immediately. If REGEX matches an empty string the scan is continued one position behind this match. BODY may start with declarations.
|
| | |
| | |
(cl-ppcre:scan-to-strings regex target-string &key (start 0)
(end (length target-string)) sharedp) | Function: Like SCAN but returns substrings of TARGET-STRING instead of positions, i.e. this function returns two values on success: the whole match as a string plus an array of substrings (or NILs) corresponding to the matched registers. If SHAREDP is true, the substrings may share structure with TARGET-STRING.
Compiler-Macro: Make sure that constant forms are compiled into scanners at compile time.
|
| | |
| | |