NOT COMPLETE YET.
This package implement POSIX Regular Expressions in Common-Lisp.
This is interesting because it's available on any Common-Lisp platform
while external C regexp libraries or internals are available or not,
and not always implement these same syntax or semantic.
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 has 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/>

README:

FUNCTION

Public

MATCH (REGEXP STRING &OPTIONAL START END)

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 (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

MATCH-START (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

MATCH-STRING (STRING MATCH)

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).

RE-NSUB (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

REGEXEC (REGEX STRING &KEY (NMATCH NIL) (BOL T) (EOL T))

RETURN: match ;
(or (not match) (null nmatch) (zerop nmatch) (re-nosub regex)) ==> nil
(eq t nmatch) ==> A vector of regmatch-t with (1+ (re-nsub regex))
items
(numberp nmatch) ==> A vector of regmatch-t with nmatch items.
WARNING: Entry #0 of the result vector is always the start and end of the
whole expression. To get the start and end of the last subexpression
you need to pass :nmatch (1+ (re-nsub regex)) [or T].

RM-EO (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RM-SO (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

BE-END-RANGE (SC)

DO: Parses an end-range.
RETURN: character or (rk:collating-symbol coll-elem)
NOTES:
end_range : COLL_ELEM_SINGLE
| collating_symbol ;
COLL_ELEM_SINGLE
Any single-character collating element, unless it is a META_CHAR.
META_CHAR
One of the characters:
^ When found first in a bracket expression
- When found anywhere but first (after an initial '^' , if any)
or last in a bracket expression, or as the ending range point
in a range expression
] When found anywhere but first (after an initial '^' , if any)
in a bracket expression

BE-EQUIVALENCE-CLASS (SC)

DO: Parses an equivalence class.
RETURN: (rk:equivalence-class coll-elem)
or (:error message)
or nil if not looking at '[='.
NOTE:
equivalence_class : Open_equal COLL_ELEM_SINGLE Equal_close
| Open_equal COLL_ELEM_MULTI Equal_close ;
META_CHAR
One of the characters:
^ When found first in a bracket expression
- When found anywhere but first (after an initial '^' , if any)
or last in a bracket expression, or as the ending range point
in a range expression
] When found anywhere but first (after an initial '^' , if any)
in a bracket expression
Inside an equivalence-class:
^ is not first in a bracket expression ==> ^ is not meta-char
] is not first in a bracket expression ==> ] is meta-char
- isn't first, shouldn't be last, isn't ending a range ==> - is meta-char

BRE-EXPRESSION (SC)

BRE-NONDUPL-RE (SC)

BRE-ONE-CHAR-OR-COLL-ELEM (SC)

DO: Parses s single character or a coll-elem regexp.
RETURN: (or (rk:matching ...) (rk:non-matching ...) rk:any character)
NOTES:
one_char_or_coll_elem_RE : ORD_CHAR
| QUOTED_CHAR
| '.'
| bracket_expression ;
QUOTED_CHAR ^ . * [ $ \
ORD_CHAR any but SPEC_CHAR
SPEC_CHAR
For basic regular expressions, one of the following special characters:
. Anywhere outside bracket expressions
Anywhere outside bracket expressions
[ Anywhere outside bracket expressions
^ When used as an anchor (see BRE Expression Anchoring )
or when first in a bracket expression
$ When used as an anchor
* Anywhere except first in an entire RE,
anywhere in a bracket expression, directly following '(' ,
directly following an anchoring '^'.
==> ORD_CHAR excludes . [ and * but when first of the expression.

BRE-SIMPLE-RE (SC)

simple_RE : nondupl_RE
| nondupl_RE RE_dupl_symbol ;

COMPILE-BRACKET-EXPRESSION (REGEXP)

RETURN: The charset described by the regex, either a rk:matching
or a rk:non-matching. The charset is not complemented for
rk:non-matching, this should be done by match function.
regexp --> (or (rk:matching mexpr...)
(rk:non-matching mexpr...)
mexpr --> (or
character
(rk:collating-symbol string/collating-element)
(rk:equivalence-class string/equivalence-class)
(rk:character-class string/class-name)
(rk:range (or coll-elem-single collating-symbol)/start
(or coll-elem-single collating-symbol)/end))
NOTE: We don't compile bracket expressions for other atoms than characters!

MAKE-CHARSET

RETURN: An instance of a subclass of charset, selected according to
the value of char-code-limit.

PJB-RE-SPLIT-STRING (STRING &OPTIONAL SEPARATORS)

DOES: Splits STRING into substrings where there are matches
for SEPARATORS.
RETURNS: A list of substrings.
separators: A regexp matching the sub-string separators.
Defaults to "[ ftnrv]+".
NOTE: Current implementation only accepts as separators
a literal string containing only one character.

RANGE-MAX (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RANGE-MIN (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RANGE-SET-SEEK (RS N)

RETURN: The last cons whose cdr+1 is >= n.

RE-ENV (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RE-EXTENDED (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RE-IGNORE-CASE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RE-INTEGER (SC)

DO: Parses an integer.
RETURN: The integer, or NIL.

RE-NEWLINE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RE-NOSUB (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-BOL (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-EOL (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-EQUALF (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-LENGTH (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-NEWLINE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-NEWLINEPF (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-POSITION (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-REGEXP (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-SEQUENCE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RENV-SUBEXPS (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RMATCH-B-ANCHOR (NODE STATE ENV)

Beginning of string anchor.

RMATCH-E-ANCHOR (NODE STATE ENV)

End of string anchor.

RMATCH-L-ANCHOR (NODE STATE ENV)

Beginning of line anchor.

RMATCH-R-ANCHOR (NODE STATE ENV)

End of line anchor.

RMATCH-REPEAT-GREEDY (NODE STATE ENV)

DO: match min to max repeatition, greatest first.

RMATCH-REPEAT-SHY (NODE STATE ENV)

DO: match min to max repeatition, smallest first.

RNODE-CHILDREN (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RNODE-MATCHF (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RNODE-TOKEN (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RSTATE-END (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RSTATE-START (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

RSTATE-TRY (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.