forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Possible String.dll problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Mon Aug 01, 2005 1:52 am    Post subject: Possible String.dll problem Reply with quote

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Aug 02, 2005 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Tue Aug 02, 2005 7:34 pm    Post subject: Reply with quote

Thanks. I do have it working now. Smile Plus I'm slowly studying more about regexes... and getting a headache Confused

Cheers.

_________________
John Trappett
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group