Also I am tired using the RegEx command in my program. Sometimes the the error message "Regular Pattern matching does not compile" is getting displayed in run time. God knows for what it is displaying? Especially while running the Exes it is really hard to debug it. Though I am not able to debug it but may be this is due to some special text like commas coming dynamically in RegEx matching in the source text.
Whatever may be the text coming or passed to the RegEx command it should not show this error message since I am not violating the syntax for the searching pattern(I made the pattern fixed) and I don't have any control over the coming text which is actually being captured from a screen.
Capture string in between two given string
Moderators: Dorian (MJT support), JRL
Hi Marcus,
I know the v12 release is keeping you pretty busy... but is there any chance you could look into the problem below?
Take care
I know the v12 release is keeping you pretty busy... but is there any chance you could look into the problem below?
Finding a fix for this one may also fix the problems that Niroj@Work is running into... they sound similar.mtettmar wrote:Seems to only happen if the replace flag is set. If not replacing there is no error. I'm not sure why. I have put it on the to do list and will investigate.jpuziano wrote:Interesting... I tried the following:
However it fails with the error: Regular Expression pattern not compiled.Code: Select all
Let>str=abcd %CRLF% hhjh jhj {select hgh %CRLF% hh=!3j h %CRLF% jh ? }jdjk jdkj jkj %CRLF% {nb bb hjdh %CRLF%%CRLF% nb jkj}%CRLF% Let>pattern=({.*?)\r\n(.*?)\r\n(.*?}) RegEx>pattern,str,0,match_array,num,1,$1%~$2~$3,new_string MDL>new_string
I'm not sure why though, maybe Marcus can shed some light.
Even if the above error could be eliminated though, I am not sure if this would catch and change multiple occurances of %CRLF% within { and } chars... it might only catch the first or last occurance within any { and } pair.
You can do this brute force with procedural code of course... but I am thinking you're looking for a regex solution here.
Marcus or anyone else, please jump in.
Take care
Last edited by jpuziano on Fri Apr 30, 2010 8:57 pm, edited 1 time in total.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
I don't get the compile error if I set the EasyPatterns flag to 1.
I did not use brackets [...]
This should not be the syntax, but it seems to work.
Gale
I did not use brackets [...]
Code: Select all
Let>str=abcd %CRLF% hhjh jhj {select hgh %CRLF% hh=!3j h %CRLF% jh ? }jdjk jdkj jkj %CRLF% {nb bb hjdh %CRLF%%CRLF% nb jkj}%CRLF%
Let>pattern=(?<={.+?)\r\n(?=.+?})
RegEx>pattern,str,1,match_array,num,1,~,new_string
MDL>new_string
This should not be the syntax, but it seems to work.
Gale
Thanks Gale for posting your findings above.gdyvig wrote:I don't get the compile error if I set the EasyPatterns flag to 1.
This should not be the syntax, but it seems to work.
Gale
Marcus, have you had any time to look further into this error and why it is produced?
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The problem is that the pattern is not a valid PCRE expression.
Put the pattern into RegExBuddy using the PCRE engine and it highlights the first +? saying:
The PCRE library does not support infinite repetition inside lookbehind
And if we remove it from the pattern so that we end up with:
(?<={.)\r\n(?=.+?})
Then we get no error.
But before anyone says anything, yes, I agree the error message produced by the regex engine that Macro Scheduler is using is not entirely helpful. I guess it just can't make sense of the pattern so gives a compile error.
Put the pattern into RegExBuddy using the PCRE engine and it highlights the first +? saying:
The PCRE library does not support infinite repetition inside lookbehind
And if we remove it from the pattern so that we end up with:
(?<={.)\r\n(?=.+?})
Then we get no error.
But before anyone says anything, yes, I agree the error message produced by the regex engine that Macro Scheduler is using is not entirely helpful. I guess it just can't make sense of the pattern so gives a compile error.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,mtettmar wrote:Seems to only happen if the replace flag is set. If not replacing there is no error. I'm not sure why. I have put it on the to do list and will investigate.
Can you update us on this one? Was a fix found or...?
Thanks and take care
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -