You need to sign in to do that
Don't have an account?
Kunal Parmar 9
Overcoming regex limits
I am trying to parse a file uploaded in my org. I am using String.split('\\n'); to split the string so that it gives me a list of strings each individual element having one line of my parsed file. The code works fine with small files. But, my application needs to work with large files, mostly 5000+ lines. I get a "Regex too complicated" error when using my application with large files. Can someone suggest a work-around for this error. Thanks!
The code is as below,
where document is my uploaded file.
The code is as below,
Blob b = document.body; String content = b.toString(); parts = content.split('\\n', -2); System.debug(parts);
where document is my uploaded file.