http://www.perlmonks.org?node_id=1015511


in reply to regex on gigabyte string

Hello focusonz, and welcome to the Monastery!

Do you need @celltags to be fully populated before proceeding? If not, it might be worth trying:

while (m{(<c.*?/c>)}g) { # Process $1... }

Just a thought (untested). Hope it helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: regex on gigabyte string
by focusonz (Initiate) on Jan 26, 2013 at 18:52 UTC

    Tried that but took interminably long execution time even on the 1GB string.

    The my @celltags = ($bigstring =~ /(<c.*?\/c>)/g); executed quickly on 1GB strings.