View previous topic :: View next topic |
Author |
Message |
mstaszew
Joined: 21 Jul 2006 Posts: 67 Location: North Carolina, USA
|
Posted: Mon Oct 19, 2009 2:16 pm Post subject: Regular expression and lexer parser question |
|
|
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 |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue Nov 10, 2009 10:45 pm Post subject: |
|
|
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 |
|
|
|