- From: Liam R. E. Quin <liam@fromoldbooks.org>
- Date: Tue, 28 Jan 2025 14:03:54 -0500
- To: LdBeth <andpuke@foxmail.com>, David Birnbaum <djbpitt@gmail.com>
- Cc: ixml <public-ixml@w3.org>
> > Regular expression *with* conditional text replacement is very > powerful, even if the regex library been used itself is limited to > regular languages (without backtracking/lookup ahead etc), with > control flow it can still be used to simulate these advanced PCRE > features with ease. Ironically i had filed an issue to add lookahead assertions to qt4, and it was turned down today. Maybe if i’d been able to get to the meeting and argue for how useful they are... :( So far the hardest part of iXML for me has generally been understanding why a grammar doesn’t match, at least once i got past the somewhat unusual syntax (; for or?? looking like prolog is not a plus for me...) In a way the nearest thing to iXML might actually be Perl 6 regular expressions, that have an explicit grammar notation available. So i wonder if there’s debugging experience there. Regular expressions do of course allow backtracking (unlike SGML DTD content models), and back-references probably make them not be regular but i’m not certain. Consider a.*b given abcdefbghi... For something small, or for picking small pieces of data out of longer text, regular expressions are a win, because they are terse and because of .* (and .+ and .*? and friends) which means in effect you can write a partial grammar and rely on the regexp engine doing backtracking. David (if you see this) thank you for the note on teaching. Get the input into a form you can more easily process it is a good general principle. -- 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
Received on Tuesday, 28 January 2025 19:03:59 UTC