FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

compile-re

Arguments: string &key case-fold ignore-whitespace multiple-lines single-line (return :unknown) back-end

Given a string that describes a regular expression, creates a compiled regular expression object.

The keyword argument case-fold controls whether the result matcher becomes case-sensitive or not by default. nil, the default, means case-sensitive, true means case-insensitive. (The 'i' flag of Perl RE).

If the keyword argument ignore-whitespace is given and true, whitespace characters within string are ignored as regexp spec. (The 'x' flag of Perl RE).

If the keyword argument multiple-lines is given and true, the created matcher recognizes multiple lines, i.e. ^ and $ matches beginning and end of individual lines. Without this argument, ^ and $ matches only beginning and end of the input string. (The 'm' flag of Perl RE).

If the keyword argument single-line is given and true, '.' will match any character including newline. Without single-line, '.' matches any character except newline. (The 's' flag of Perl RE).

The keyword argument return specifies how the created matcher returns the result. If it is nil, the matcher will return only a boolean value which indicates whether the input string matches the regexp or not. If it is :string, the matcher also returns the substrings of the matched region and all submatches of the input string. If it is :index, the matcher returns pairs of start and end indices of the matched region and all submatches. If the keyword argument is not given at compile time, the matcher is created so that it will accept return keyword argument at the matching time; however, compile-re will generate more efficient code if it knows the return type at the compile time. (The default is :unknown, which has the effect just described.)

The back-end keyword argument can only have its default value regexp:vm and should not be specified. Additional allowable values may be added later. (The value regexp:native, incorrectly mentioned as an allowable value in earlier documentation versions, is not supported at this time.)

The symbol naming this operator is also exported from the regexp package.

See The new regexp2 module in regexp.htm for further information on this function and the regexp2 module.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version