Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regular expression "findrx" fails when source string length is 2610 or larger
#1
Hi everybody

I have a bunch of txt files with lines of text (aprox. 30-50 lines)
I use regular expression to get part of the content between two words "Hello" and "Regards", it works fine but some of the files crash due to the content is larger than findrx can handle.

I have spent som time and found the triggering limit is when my string "txtIndex" which contains the data from text file is the lenght of 2610 or more, then I get the error:
"failed: Regular expression stack overflow."


can I expand the memory limit?
Should I use something else than a string to store data from the text file?


My macro is:

Macro getLetterContent
Code:
Copy      Help
str txtIndex.getfile("C:\sampleData.txt")
out len(txtIndex)

str letterContent
int i
str pattern = "(?<=Hello)(.|\n)*(?=Regards)"
i=findrx(txtIndex pattern 0 0 letterContent)
out letterContent


Messages In This Thread
regular expression "findrx" fails when source string length is 2610 or larger - by TheDane - 11-14-2018, 08:47 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)