http://qs321.pair.com?node_id=11114925


in reply to Re: regex question
in thread regex question

Very imaginative, but in reality my lines look not like "1 A" but rather like "1 string1 string2 string3" and so your approach would not work anymore.

But your idea is cool.

Replies are listed 'Best First'.
Re^3: regex question
by AnomalousMonk (Archbishop) on Apr 01, 2020 at 23:08 UTC

    Clear questions elicit clear and helpful answers. What should the content of your hash look like given the new data format? Do any of the other solutions given so far produce that structure | hash content?


    Give a man a fish:  <%-{-{-{-<

Re^3: regex question
by rsFalse (Chaplain) on Apr 02, 2020 at 15:17 UTC
    If you want to match "1 string1" from "...\n1 string1 string2 string3\n...", use anchor '^', otherwise modifier 'm' is redundant. Did it help?