NextPrevUpTopContentsIndex

regexp-find-symbols

Function
Summary

Returns a list of symbols that match a supplied regular expression.

Package

lispworks

Signature

regexp-find-symbols regexp-string &key case-sensitive packages test external-only => symbols

Arguments

regexp-string

A string.

case-sensitive

A boolean.

packages

A list of package designators, a single package designator, or the keyword :all .

test

A function of one argument returning a boolean result.

external-only

A generalized boolean.

Values

symbols

A list of symbols.

Description

The function regexp-find-symbols returns a list of symbols that match the regular expression in regexp-string .

case-sensitive determines whether the match is case sensitive. The default value of case-sensitive is nil .

packages specifies in which packages to search. The default value of packages is :all , meaning search in all packages.

test , if supplied, must be a function of one argument, which returns t if the argument should be returned, and nil otherwise. The function test is applied to each symbol that matches regexp-string , and if it returns nil the symbol is not included in the returned value symbols . If test is nil all matches are returned. The default value of test is nil .

external-only , if true, specifies that only external symbols should be checked, which makes the search much faster. The default value of external-only is nil .

The regular expression syntax used by regexp-find-symbols is similar to that used by Emacs, as described in the "Regular expression syntax" section of the LispWorks Editor User Guide .

Examples

To find all exported symbols that start with DEF:

(lw:regexp-find-symbols "^def" :external-only t)

To find all symbols that contain lower case "slider":

(regexp-find-symbols "slider" :case-sensitive t)
See also

apropos
find-regexp-in-string


LispWorks Reference Manual - 20 Jul 2006

NextPrevUpTopContentsIndex