The major issue is probably [\d\D]*? which matches everything (ie digits and non digits == everything) and then backtracks. Anyway your REs are a bit ugly. OK really ugly. There is also absolutely no reason to use $r_file as you never pass $file outside of 'main'. Also you have a useless set braces.
If you post what you want to do ie input/change file/output then I am sure you will get plenty of help. We need to see the exact input data, exact change file data, and desired output. </code>
cheers
tachyon
In reply to Re: RegEx on 4MB file consumes of 2GB of ram before windows shuts it down.
by tachyon
in thread RegEx on 4MB file consumes of 2GB of ram before windows shuts it down (Memory Leak in 5.8.2)
by Ardemus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |