Next: irregex sre, Previous: irregex misc, Up: irregex [Index]
Since the PCRE syntax is so overwhelming complex, it’s easier
to just list what (vicare irregex) does not support
for now. Refer to the PCRE documentation for
details.18
\P) are not supported, but will be in
an upcoming release. \C named characters are not supported.
(*FOO) patterns are not supported and may never be.
\G and \K are not supported.
Other than that, everything should work, including named submatches, zero–width assertions, conditional patterns, etc.
In addition, \< and \> act as beginning–of–word and
end–of–word marks, respectively, as in Emacs regular expressions.
Also, two escapes are provided to embed SRE patterns inside
PCRE strings, "\'<sre>" and "(*'<sre>)". For
example, to match a comma–delimited list of integers we could use:
"\\'integer(,\\'integer)*"
and to match a URL in angle brackets we could use:
"<('*http-url)>"
note in the second example the enclosing "('*...)" syntax is
needed because the Scheme reader would consider the closing ‘>’ as
part of the SRE symbol.
The following chart gives a quick reference from PCRE form to the SRE equivalent:
;; basic syntax
"^" ;; bos (or eos inside (?m: ...))
"$" ;; eos (or eos inside (?m: ...))
"." ;; nonl
"a?" ;; (? a)
"a*" ;; (* a)
"a+" ;; (+ a)
"a??" ;; (?? a)
"a*?" ;; (*? a)
"a+?" ;; (+? a)
"a{n,m}" ;; (** n m a)
;; grouping
"(...)" ;; (submatch ...)
"(?:...)" ;; (: ...)
"(?i:...)" ;; (w/nocase ...)
"(?-i:...)" ;; (w/case ...)
"(?<name>...)" ;; (=> <name>...)
;; character classes
"[aeiou]" ;; ("aeiou")
"[^aeiou]" ;; (~ "aeiou")
"[a-z]" ;; (/ "az") or (/ "a" "z")
"[[:alpha:]]" ;; alpha
;; assertions
"(?=...)" ;; (look-ahead ...)
"(?!...)" ;; (neg-look-ahead ...)
"(?<=...)" ;; (look-behind ...)
"(?<!...)" ;; (neg-look-behind ...)
"(?(test)pass|fail)" ;; (if test pass fail)
"(*COMMIT)" ;; commit
Next: irregex sre, Previous: irregex misc, Up: irregex [Index]