Re: Trouble figuring out xmlregexp regular expressions
Timothy Wrona via xml <[email protected]> Sat, 20 Mar 2021 23:30:22 -0400
| Newsgroups | gmane.comp.gnome.lib.xml.general |
|---|---|
| Message-ID | <CAGrOMv2GixcQCqhtWTVpXxKKURGjynKKxeQDOO9jq3Sk6J5WYQ@mail.gmail.com> |
--===============4945593577980719451== Content-Type: multipart/alternative; boundary="00000000000075b4ab05be039258" --00000000000075b4ab05be039258 Content-Type: text/plain; charset="UTF-8" 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, Mar 20, 2021 at 3:30 PM Liam R. E. Quin <[email protected]> wrote: > 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 > > --00000000000075b4ab05be039258 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thanks for the extra info :)<div><br></div><div>I did a fe= w tests and confirmed that this regex library appears to work for the regul= ar expressions I will need to parse. Character class subtractions (a featur= e somewhat unique to the XML Schema regex language) seems to work, and it d= oes appear to implicitly anchor the expressions as if they started with ^ a= nd ended with $.</div><div><br></div><div>I don't think I will need a &= quot;replace" feature since I am just taking regular expressions from = "pattern" fields in xsd files and using them to match strings.</d= iv><div><br></div><div>Thanks,</div><div>Tim</div></div><br><div class=3D"g= mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 20, 2021 at 3= :30 PM Liam R. E. Quin <<a href=3D"mailto:[email protected]">liam@fr= omoldbooks.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" st= yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd= ing-left:1ex">On Sat, 2021-03-20 at 00:05 -0400, Timothy Wrona via xml wrot= e:<br> > Hi,<br> > <br> > I am working on a library that will need to parse strings using<br> > regular<br> > expressions conformant to the XML Schema regular expression grammar=C2= =A0<br> <br> A side-note: XPath 3 (and 2 actually) extends the regular expressions,<br> because it adds replace(), and XML Schema regular expressions weren't<b= r> designed for that.<br> <br> Schema's regular expressions are also implicitly anchored as if they<br= > started and ended with ^ and $, which limits their usefulness in<br> parsing; likely the underlying C code enforces that outside the regexp<br> engine though.<br> <br> Liam<br> <br> -- <br> Liam Quin,=C2=A0<a href=3D"https://www.delightfulcomputing.com/" rel=3D"nor= eferrer" target=3D"_blank">https://www.delightfulcomputing.com/</a><br> Available for XML/Document/Information Architecture/XSLT/<br> XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.<br> Barefoot Web-slave, antique illustrations: =C2=A0<a href=3D"http://www.from= oldbooks.org" rel=3D"noreferrer" target=3D"_blank">http://www.fromoldbooks.= org</a><br> <br> </blockquote></div> --00000000000075b4ab05be039258-- --===============4945593577980719451== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] https://mail.gnome.org/mailman/listinfo/xml --===============4945593577980719451==--