Problem with regex, special characters

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Sébastien Hivon
Avatar
Hi

I have the following regex paterns: PatternValue="[\d\w]" and it doesn't get specials characters. Like this one: ﺡ

I have made another application and that use .net regex and those characters are catched by \w.

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
What version of SyntaxEditor do you have? I tried it in our latest SyntaxEditor 3.1 version and it worked fine. Make sure you have SyntaxEditor.UnicodeEnabled set to true and also that you have Use Regular Expressions on in the find options.


Actipro Software Support

Posted 14 years ago by Sébastien Hivon
Avatar
It's not in the find dialog that I have the problem, but with the xml config file. (Maybe the search works the same way)

Let me explains what I want to do:
I want to detect an invalid patern of text on a line. It's allowed to write text after tab 1, 2, 3, 4; not 0 or greater than 4.
Right now, if I write normal text at tab 0, the token is detected
if I write normal text + special characters, the token is detected
if I write ONLY special characters, the token is NOT detected.

<Scopes>
    <Scope>
        <RegexPatternGroup TokenKey="InvalidStartToken" Type="StartScope" Style="Invalid" PatternValue="[\d\w]" LookAhead="[^\t{1,4}]|\t{5,}" />
        <RegexPatternGroup TokenKey="InvalidEndToken" Type="EndScope" Style="EndTag" PatternValue="\n" />
    </Scope>
</Scopes>
Maybe It's not the easiest way to do it, but it work for me, except for the special characters.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you email us your language definition so we can load it in our sample project and debug it? That would help.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.