Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Possible to have regexes act on file directly (not in memory)

by hippo (Abbot)
on May 02, 2014 at 17:06 UTC ( #1084818=note: print w/replies, xml ) Need Help??

in reply to Possible to have regexes act on file directly (not in memory)

You already have one answer: split the file into chunks and test each chunk. Can you tell us why you have discarded that approach?

  • Comment on Re: Possible to have regexes act on file directly (not in memory)

Replies are listed 'Best First'.
Re^2: Possible to have regexes act on file directly (not in memory)
by brianski (Novice) on May 04, 2014 at 01:27 UTC
    How would you deal with regular expressions of variable length that cross 2 chunks? What about 3 chunks?
      Did anyone read this thread before posting?

      Or even tried following the links provided, leading to answers already given 13 years ago?

      To say it plain, this theoretical idea of regexes creating unlimited matches is bullshit academic masturbation.

      If the match is indeed too large to hold two chunks in memory (which have to be individually bigger than the maximal match), in what way do you expect to be able to process this match???

      Truth is it's far harder to construct problems which can't be solved with sliding windows, then just to solve the real world tasks.

      Cheers Rolf

      ( addicted to the Perl Programming Language)


      PS: If a little boy asks for a birthday cake bigger than any building on earth, do you really honestly start discussing where to find suitable candles?

    • expanded title

        No, it's not academic masturbation.

        This is not the first time I would need such thing due to a concrete real-world-problem.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1084818]
[choroba]: erix Seems too complex
[erix]: do you mean: 'it can be done simpler', or 'it won't work' ?
[choroba]: I wouldn't want to maintain it in the current form
[erix]: ok, but mainainability comes after it has been made to work :)
[erix]: maybe I should have cobbled together a more simple example
[erix]: the main question is whether repeating groups get captured. I thought they did but it looks they do not.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-01-19 08:36 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (216 votes). Check out past polls.