[9fans] ... --- ... - Plan9

This is a discussion on [9fans] ... --- ... - Plan9 ; hi all, my problem is to read-in the data in the form(regex): [0-9]+'-'[0-9]+[acr] e.g., : 0-2a 3-4c 6-8r to obtain: a a a c c [blank] r r r Is this better to be solved by 'lex', or directly in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [9fans] ... --- ...

  1. [9fans] ... --- ...


    hi all,
    my problem is to read-in the data in the form(regex):
    [0-9]+'-'[0-9]+[acr]
    e.g., : 0-2a 3-4c 6-8r
    to obtain:
    a a a c c [blank] r r r

    Is this better to be solved by 'lex', or directly in C?? Could someone, please, hint???

    Big 'Thank You',

    Peter.

  2. Re: [9fans] ... --- ...

    hand code that part. it's a bit tricky but not too hard.
    i've done it dozens of times (got it right 20 years ago
    and use copy/paste). almost any screwy requirement
    is best done by just doing it. lex has it's land but it will
    drive you insane - and in a parallel universe you've
    finished the C code.

    ken's code is different to mine but i'd copy/paste it
    in a second.

    brucee

    On 2/5/07, cej@gli.cas.cz wrote:
    >
    > hi all,
    > my problem is to read-in the data in the form(regex):
    > [0-9]+'-'[0-9]+[acr]
    > e.g., : 0-2a 3-4c 6-8r
    > to obtain:
    > a a a c c [blank] r r r
    >
    > Is this better to be solved by 'lex', or directly in C?? Could someone, please, hint???
    >
    > Big 'Thank You',
    >
    > Peter.
    >


+ Reply to Thread