in reply to regular expressions question

This is an example -- the LEVINE'S TEST FOR VARIANCES comes up multiple times throughout the file. I need to suck out the column that has 0.5422 in it each time.
If the column has "0.5422" in it each time, there's no need to "suck it out", as you already know what's there.

Abigail

Replies are listed 'Best First'.
Re: Re: regular expressions question
by ysth (Canon) on May 03, 2004 at 17:44 UTC
    My interpretation (hardly a stretch at all):
    the "LEVINE'S TEST FOR VARIANCES" comes up multiple times...I need to suck out the column that [in this example] has 0.5422 in it each time [a line has TEST FOR VARIANCES]
      My interpretation
      When it comes to problem description, I try to avoid as much reading between the lines as possible. Specially when it comes to regular expressions. Sure, I could have given him a regex according to some interpretation. Would that have solved his immediate problem? Perhaps, if my interpretation happened to be right. Would he have learned anything, that is, would he have been able to solve his next regex problem? Probably not.

      No, instead I try him to think again. To look at the problem - poke at it, disect it, and formulate what he really wants. Formulate a regexp problem properly, and you have solved it for 90% - all you need to do is the translation to an arcane language - but that's fairly mechanical at that point.

      In Dutch we have a saying "Zachte heelmeesters maken stinkende wonden", which translated means something like "Gentle healers make festering wounds".

      Abigail

        No, instead I try him to think again.

        How many times do you usually try a guy before a second thought comes to you?

        When someone isn't completely clear, I find that making a sarcastic remark is very effective in promoting learning. Oh, and I have a lot of sayings that apply and I suspect you've heard many of them.

        - tye