Package COM.INFORMATIMAGO.COMMON-LISP.REGEXP.REGEXP-EMACS

NOT COMPLETE YET.

This package implement REGEXP in COMMON-LISP, which is interesting
because then it's available on any COMMON-LISP platform whether the
external C regexp library is available or not, and moreover, it's the
same (that is, it's compatible) on all COMMON-LIST platforms.


Posix Regexp implemented in Common-Lisp.

See specifications at:
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap09.html

This is a strict implementation that will work both in clisp
(Common-Lisp) and emacs (with cl and pjb-cl Common-Lisp extensions).

This implementation is entirely in lisp, contrarily to what regexp
packages are available under clisp or emacs.  Thus it as the advantage
of portability and availability (you don't have to compile or link
a lisp system written in some barbarous language, and you get the same
regexp features in all programs including this module).



License:

    AGPL3

    Copyright Pascal J. Bourguignon 2002 - 2012

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.
    If not, see <http://www.gnu.org/licenses/>

match
structure
This structure stores a (start,end) couple specifying the range matched
by a group (or the whole regexp).
(match regexp string &optional start end)
function
Common-Lisp: This function returns as first value a match structure
containing the indices of the start and end of the first match for the
regular expression REGEXP in STRING, or nil if there is no match.
If START is non-nil, the search starts at that index in STRING.
If END is non-nil, only (subseq STRING START END) is considered.
The next values are match structures for every '(...)' construct in REGEXP,
in the order that the open parentheses appear in REGEXP.


start:   the first character of STRING to be considered (defaults to 0)
end:     the after last character of STRING to be considered
         (defaults to (length string)).
RETURN:  index of start of first match for REGEXP in STRING, nor nil.

MATCH-END

MATCH-START

(match-string string match)
function
Extracts the substring of STRING corresponding to a given pair of
start and end indices. The result is shared with STRING.
If you want a freshly consed string, use copy-string
or (coerce (match-string ...) 'simple-string).

REGEXP-QUOTE