FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

parse-re

Arguments: string &key extended-mode

The several functions that accept quasi-Perl string representation for regular expressions (e.g. match-re) also accept parse tree syntax. parse-re is the function that translates the string representation into the tree representation. It is used internally as the first pass of compile-regexp, but occasionally is may be useful in application code.

The extended-mode keyword argument controls whether the parse begins in regular or extended mode. The default is nil. If true, it is as if the regexp string is prefaced with "(?x)".

Example

cl-user(11): (parse-re ".*")
(:greedy-repetition 0 nil :everything)
cl-user(12): (parse-re ".*?")
(:non-greedy-repetition 0 nil :everything)
cl-user(13): (parse-re "^[A-E]")
(:sequence :start-anchor (:char-class (:range #\A #\E)))
cl-user(14): (parse-re "i.*s")
(:sequence #\i (:greedy-repetition 0 nil :everything) #\s)
cl-user(15): 

See Regexp trees in regexp.htm for information on the tree syntax.

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.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version