| View previous topic :: View next topic |
| Author |
Message |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Mon Aug 01, 2005 1:52 am Post subject: Possible String.dll problem |
|
|
Dread.. I did try to send this to support@dread.dk but got this response:
----- The following addresses had permanent fatal errors ----- <support@dread.dk>
(reason: 554 5.7.1 This message has been blocked because it is from a RBL/ORDBL IP address.)
I’m getting an error from the Regular Expression search function in string.dll in one of my programs. To show the error I’ve just made this quick mock-up script: | Code: | Title RegExp Test
external String.dll
#define function, string
list create, 1
list loadtext, 1
"Thunderstone
"Today
"Sunrise
"Totally Wild
"King
"Cheez TV
"Sunday Roast (+) Sunday Footy Show (+) Boots 'N' All
"Rotten Ralph
"Insiders
"Italian News
if @string(RegxFind, @text(1), "Sunday Roast (+) Sunday Footy Show (+) Boots 'N' All"),1,)
info Found it!
else
info No go!
end
exit | The error I’m getting is:
Error: Error in external command or function
I’m just wondering if the problem is more my (mis)understanding of Regular Expressions. I have since found that + is a special character, though I didn’t think that it would cause the function to error. I have tried to escape the + by replacing each occurrence with \+ . It then doesn’t error, however, it also doesn’t match.
If I replace + (plus) with a . (dot) then it also doesn’t match even though I thought the dot means “match any character”.
What does work is if I replace the + (plus) with .+ (dot plus), although I’m not sure why it works.
Cheers. _________________ John Trappett |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Aug 02, 2005 7:24 am Post subject: |
|
|
It's not likely an error in the DLL.
Firstly your search expression has an excess closing parenthesis that may cause problems.
Secondly it could be a good idea to study reg-exes. Any metacharacters need to be escaped to work as
literals. So that goes for parenthesis chars and the plus'es. You could use the EscapeRegXChars function
if in doubt.
+ alone doesn't work coz + is an iterator that iterates the preceding char so you'll need a valid char or
metachar (like . ) in front of it.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Tue Aug 02, 2005 7:34 pm Post subject: |
|
|
Thanks. I do have it working now. Plus I'm slowly studying more about regexes... and getting a headache
Cheers. _________________ John Trappett |
|
| Back to top |
|
 |
|