Function | Package: excl | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 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-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version