[Techtalk] A (Difficult?) Regular Expression Construction
Question
Kai MacTane
kmactane at GothPunk.com
Mon Sep 8 12:03:34 EST 2003
At 9/8/03 05:43 AM , Jacinta Richardson wrote:
>Relying on changes in alphabetic ordering seems like an insane way to
>build a tree, if you don't mind me saying so. Far, far too often you'll
>want to start a new branch yet just happen to have a title that doesn't
>change in your alphabetical ordering.
>[snip]
>If this is a homework question then I wish you luck (because it seems
>insane to me). If it's a real life question then I'm, sorry but your data
>is screwed and you really need to get someone to walk through it and
>delineate what should be a title, subtitle, subsubtitle etc.
This is pretty much my feeling, too. Whether it's a homework question or a
real-world situation, the delineation between "indent levels" should be
made by something other than alphabetical order.
Indeed, why not just use leading tabs or spaces? (Personally, I'd prefer
tabs, because the indents are then easier to see.) Then, you just count the
number of leading tabs, and that's your indent level.
I think the parsing as it's currently defined (and vaguely defined, at
that) is basically dependent on judgement calls by humans -- and judgement
calls that are easily mistaken, due to the vagueness in the data definition.
--Kai MacTane
----------------------------------------------------------------------
"Soft and only you, lost and only you,
Strange as angels."
--The Cure,
"Just Like Heaven"
More information about the Techtalk
mailing list