Re: Line/string triage?

On Sun, Mar 23, 2025, at 00:41, Liam R. E. Quin wrote:
> On Sat, 2025-03-22 at 21:41 -0400, Graydon Saunders wrote:
>> I find myself feeling like it isn't necessarily a good idea to mix in regular expression concepts.
> 
> A regular expression is just a compact notation - perhaps excessively compact - for expressing a grammar. So there's already some overlap.
This is entirely so, but the habits and syntax of regular expressions run in some deep grooves of expectation (anybody on this list remember not knowing regular expressions?), and I don't know as ixml's syntax benefits from those patterns of expression being introduced.

~[] is conceptually regular expression . but I really don't want to have to mix my expectations for how things get expressed.

> Agreed, a negative lookahead assertion seems odd without also having a positive one, when you look it from that perspective, but maybe there aren't any use cases for the positive ones. Although if they were added, maybe uses would arise :)

Very likely!

I think the thing I was trying to get at was the idea that it might be better to take two steps back and say "what is the ixml way to express this?" rather than the one step back and "how nearly can we introduce the regular expression thing that does this?"

This started with "how do I get it to not take lines that start with 'Chapter'?" and experience causes me to expect that if I need to do that I'll be dealing with content that usually starts with "Chapter" but might decide to spell "Chapter" as "Division" or "Sub-part" (or "Chapitre") and ideally I'd like a syntax that allows this to be expressed with producing an absolutely thicket in which to trap the insufficiently wary. Which seems like it'd be its own thing, distinct from an analog to lookahead assertions at the character level.

--  
Graydon Saunders  | graydonish@fastmail.com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")

Received on Sunday, 23 March 2025 05:08:52 UTC