I'm trying to a simple Text Find / Replace with the expression (.*?word) which will match all text from the beginning of the file to 'word' but it will only match the first line.
Any suggestions?
I'm trying to a simple Text Find / Replace with the expression (.*?word) which will match all text from the beginning of the file to 'word' but it will only match the first line.
Any suggestions?
Hi Mike
By default the regex engine is set to single line off and multiline on. You need single line on for this to work. Try adding the single line modifier :
((?s).*?word)
This works for me.
HTH
How is the performance?
I am trying to replace ((?s).*?CUTHERE\*\*\/) with blank space but the step has been running for over 20 minutes using 50% CPU on a dual core system.
It's a 1mb .SQL script file so I don't think it should take that long... I'm simply trying to remove all the lines from the beginning of the document to the line that is /**CUTHERE**
if I understand you correctly, you might be much better off using the ‘String Pos’ function to find the position of the CUTHERE part. Save this position to a variable, then using the ‘String SubString’ action to store the text up to that position into a variable. Then do a ‘String Replace’ on that to replace with empty string.
Hi Mike
I tested here with a 3Mb text file which had 13000+ matches and it took 1 minute. I’m not sure why it was taking so long for you. If you send us the FB project (with just the text replace action is fine) and the text file then we take a look and see what is happening.
The good news is I just replaced the regex engine on the action (backported the action from the next version of FB, which uses pcre as the regex engine) and the same action took just over 1 second! I’m not sure yet whether the improvements come from regex engine or some other optimizations done on the action (I removed a lot of code as the new regex engine does a lot more).
I’ll post here again when a new build with the change is available (in an hour or so).
Hi Mike
Try this build :
https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_1743.exe
I have tested the action on this build as much as I could, running side by side with the older build to compare behavior, and so far the only difference I have found is the improved performance.
Posted By Vincent Parrett on 29 Sep 2009 08:12 PM
Hi Mike
Try this build :
https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_1743.exe
I have tested the action on this build as much as I could, running side by side with the older build to compare behavior, and so far the only difference I have found is the improved performance.
That worked wonderfully! Thanks!