(cl-ppcre:all-matches regex target-string &key (start 0)
(end (length target-string))) | Function: Returns a list containing the start and end positions of all matches of REGEX against TARGET-STRING, i.e. if there are N matches the list contains (* 2 N) elements. If REGEX matches an empty string the scan is continued one position behind this match.
Compiler-Macro: Make sure that constant forms are compiled into scanners at compile time.
|
| | |
| | |
(cl-ppcre:all-matches-as-strings regex target-string &key (start 0)
(end (length target-string)) sharedp) | Function: Returns a list containing all substrings of TARGET-STRING which match REGEX. If REGEX matches an empty string the scan is continued one position behind this match. 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.
|
Example:
(defun extract-words (text)
(delete-duplicates
(cl-ppcre:all-matches-as-strings
"[a-zA-Z]{3,}" text)
:test #'string=))
| |
| | |