in reply to Usage of regular expressions in input separator

No, it's not possible.

I expect the reason to be is that you may have to read the entire input stream up to EOF with some patterns - and put them back on the input stream if there's no longer match. (Suppose your delimiter is $/ = /(.).*\1/), and that may be a costly (specially in memory usage) operation -- or your process could just "hang" forever (if it's trying to read all your standard input, or reading from a (bidirectional) pipe or network socket).

I can see the point, but I would be willing to pay the price. Sure, in degenerated cases it would be costly (so, don't do that), in practice, people would use patterns (like the one you gave), that only requires a limited lookahead.

But it's too late in the game to change $/ from a fixed string to a pattern -- not does it seem to be an itch of any of the active porters. So, I don't expect this to change any time soon.

  • Comment on Re: Usage of regular expressions in input separator