EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Regular expression and lexer parser question

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Mon Oct 19, 2009 2:16 pm    Post subject: Regular expression and lexer parser question Reply with quote

If I have a parser rule for a lexer set to look for the following...

[\w$\#]+

...then it correctly treat underscores as word characters. If I tweak the expression to handle Unicode...

(?r)[\w$\#]+

...then underscores are no longer handled as word characters. Is this correct or a bug?

Thanks,
Michael
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue Nov 10, 2009 10:45 pm    Post subject: Reply with quote

Yes, it is a bug.
Fix (ecStrUtils.pas, 747)

Code:

function IsIdentChar(const C: AnsiChar): Boolean;
begin
  Result := IsIdentLetterChar(C) or IsIdentDigitChar(C)
            or (C = '_'); // it was omitted
end;
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor 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


Powered by phpBB © 2001, 2005 phpBB Group