We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to highlight the text while it end with some specific character?

We can customize the color of line if it is end with specific character. It can be achieved by setting the lexem in custom config file.

                         

Lexem: It contains rules for parsing the text. There are two attributes to specify the format of the lexem.

 

  • Type: Type is used for standard predefined types of the lexems.
  • FormatName: The FormatName is used only when Type is Custom.

 

Here we have highlighted the line if end with “!” character. The following code demonstrates the same.

 

Code Example: [XML]

 

<!-- Configuaration -->

 

<ConfigLanguage name="new" CaseInsensitive="true">

 

<formats>

 

<!-- Highlight color -->

 

<format name="String" Font="Courier New, 13pt, style=Bold" FontColor="Green" />

 

</formats>

 

<extensions>

 

<extension>new</extension>

 

</extensions>

 

<lexems>

 

<!-- Set the Required Highlight format -->

 

<lexem BeginBlock="[A-z\s]+\!" IsBeginRegex="true"  Type="String"/>

 

</lexems>

 

<splits>

 

<split IsRegex="true">[A-z\s]+\!</split>

 

</splits>

 

</ConfigLanguage>

 

 

Code Example: [C#]

 

 

Screenshot

 

 

Sample: SyntaxEditorSample

 

 



Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
8849 06/14/2018 06/14/2018 WinForms EditControl 4
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon