in reply to An "ethical" use of dot-star ..?

If you understand backtracking, you won't need to ask such questions. I've recently read Jeffrey Friedl's "Mastering Regular Expressions" (2nd Ed.), and while I knew the key points about pattern matching - even backtracking - already, it helped me put it all together into a bigger image. .* is fine if you know what it means - it just means something very, very different from what people intuitively expect. The star itself is much misunderstood and overused to begin with; you can write much more efficient and precise patterns if you know when not to and when to specifically use it. "Death to Dot Star" touches on the issues (and help me gain much of my pre-book understanding), but it is simply too short to give you a better understand of the big picture.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: An "ethical" use of dot-star ..?
by Anonymous Monk on Jun 03, 2003 at 03:22 UTC
    If you understand backtracking, you won't need to ask such questions.

    You do? So, explain already.

    Many of us don't, and maybe that is because the existing texts are too dense on the subject.

    Maybe, given you new-found understanding fresh in your mind, you can put the concept into words that others in your prior condition will be able to follow and assimilate?

      I can try (although I admit I am too lazy to - but see below), but keep in mind that Ovid tried too in his famous node, and while that one helped me a lot, it was no substitute for the book. Regular expressions basically are (as Larry observed in the relevant Apocalypse) a language unto themselves, and noone (or so I'd hope) would expect to learn a programming language from one post on a forum. One thing that struck me as I read the book was that there are many references, both backward and forward, all over the book. I may try at some point (and then it is likely to be a series of nodes rather than just one), but I don't believe I will manage to explain the mechanics better than the book, and certainly not in as much depth.

      Makeshifts last the longest.