Re: [xml] Trouble figuring out xmlregexp regular expressions
- From: Timothy Wrona <tjwrona1992 gmail com>
- To: "Liam R. E. Quin" <liam fromoldbooks org>
- Cc: xml <xml gnome org>
- Subject: Re: [xml] Trouble figuring out xmlregexp regular expressions
- Date: Sat, 20 Mar 2021 23:30:22 -0400
Thanks for the extra info :)
I did a few tests and confirmed that this regex library appears to work for the regular expressions I will need to parse. Character class subtractions (a feature somewhat unique to the XML Schema regex language) seems to work, and it does appear to implicitly anchor the expressions as if they started with ^ and ended with $.
I don't think I will need a "replace" feature since I am just taking regular expressions from "pattern" fields in xsd files and using them to match strings.
Thanks,
Tim
On Sat, 2021-03-20 at 00:05 -0400, Timothy Wrona via xml wrote:
> Hi,
>
> I am working on a library that will need to parse strings using
> regular
> expressions conformant to the XML Schema regular _expression_ grammar
A side-note: XPath 3 (and 2 actually) extends the regular expressions,
because it adds replace(), and XML Schema regular expressions weren't
designed for that.
Schema's regular expressions are also implicitly anchored as if they
started and ended with ^ and $, which limits their usefulness in
parsing; likely the underlying C code enforces that outside the regexp
engine though.
Liam
--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]