Jump to content
Excelsior Forums
excbv

Problem with RegComp module in v. 2.51

Recommended Posts

Hello,

I haven't used the RegComp module very much so I'm not familiar with it. However, recently I began using it, and I encountered problems. For example, the following regular expression, which seems to conform to the user manual specs

([0-9,A-Z,a-z,_]{0-9,A-Z,a-z,_})$1.*

results in a compilation error (when the Compile procedure is applied) in the next to last position. Can someone explain?

Regards,

excbv

Share this post


Link to post
Share on other sites

Hello,

I just realized that I did not post a program example for the problem I described. Here it is:

<*+ MAIN *>

MODULE Test;

(*

Testing RegComp module; srcxp gives error output

*)

IMPORT In,Out,RegComp,Wh:=WholeStr;

CONST

backSl=134C;

srcxp="([0-9,A-Z,a-z,_]{0-9,A-Z,a-z,_})$1.*";

VAR re:RegComp.Expr; res:LONGINT; ch:CHAR;

str: ARRAY 32 OF CHAR;

BEGIN In.Open; Out.Open;

RegComp.Compile(srcxp,re,res);

IF res>=0 THEN Out.String("OK")

ELSE Wh.IntToStr(-res,str);

Out.String("error in position ");

Out.String(str)

END;

Out.Ln;

Out.String("press RETURN to terminate");

In.Char(ch)

END Test.

The program indicates an error in position 34 of srcxp

Any answer would be appreciated.

Regards,

excbv

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×