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. Image for the cookie policy date

Lexem Issue

I'm trying to color a simple string like "hello" with custom lexem and it doesn't seem to work.  I know it can work because the SQL language built in highlights it just fine.  Is there a way to view the resources for the SQL language to see how this is done?  The problem with this one is that it highlights green but nearby text also highlights in some cases. 

<syncfusion:Lexem StartText=""[\w]+"" IsRegex="True" ContainsEndText="False" IsMultiline="False" LexemType="Literals" FormatName="ReturnFormat"/>

 


5 Replies

KP Karuppasamy P Syncfusion Team December 12, 2013 04:41 AM UTC

Hi Kevin,

Thanks for using Syncfusion Products.

We have done a sample in which the strings get highlighted using Lexem in CustomLanguage. 

Kindly go through the sample, and if this is not your scenario please revert back to us with modified sample and share more details related to this query with us, it would be helpful for us to understand your requirement clearly.

Thanks, 
Karuppasamy P


LexemSampleDemo_a2fb211e.zip


KN Kevin Nichols December 12, 2013 08:26 PM UTC

Sorry I wasn't clear in my question.  I want to color a string green IF it is enclosed by quotes.

So

"Hello" would be green

Hello would be black

 



KN Kevin Nichols December 12, 2013 08:47 PM UTC

I have it working now.  It works without regular expression.

<syncfusion:Lexem StartText=""" EndText=""" ContainsEndText="False" IsMultiline="False" FormatName="ReturnFormat"/>



KN Kevin Nichols December 12, 2013 09:10 PM UTC

Well with this method brackets will not work.  With this input the quoted value is correct but everything adjacent to the right of bracket value is colored.

hello"hello"hello[hello]hello

<syncfusion:FormatsCollection x:Key="CustomLanguage">

<syncfusion:EditFormats Foreground="Green" FormatName="ReturnFormat"/>

<syncfusion:EditFormats Foreground="Purple" FormatName="ValueFormat"/>

</syncfusion:FormatsCollection>

<syncfusion:LexemCollection x:Key="CustomLangaugeLexem">

<syncfusion:Lexem StartText=""" EndText=""" ContainsEndText="False" IsMultiline="False" FormatName="ReturnFormat"/>

<syncfusion:Lexem StartText="[" EndText="]" ContainsEndText="True" IsMultiline="False" FormatName="ValueFormat"/>

</syncfusion:LexemCollection>



KP Karuppasamy P Syncfusion Team December 19, 2013 06:01 AM UTC

Hi Kevin,

Sorry for the delay being caused.

It seems an issue in the Edit Control. We have created an incident #117133 in the Direct Trac, kindly follow the same for further technical updates.

Thanks,
Karuppasamy P

Loader.
Up arrow icon