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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Lexem with Regular Expressions

Thread ID:

Created:

Updated:

Platform:

Replies:

106757 Jan 24,2013 07:14 AM UTC Feb 4,2013 12:16 PM UTC WPF 3
loading
Tags: EditControl
Marty Honea
Asked On January 24, 2013 07:14 AM UTC

I'm having a hard time getting Lexems to work with Regular Expressions.
 
I am trying to color code a formula. I need to be able to color code tokens even if they aren't surrounded by a blank space.
 
In the following Formula, How do I write the lexem to set the color of the tokens Inv StartToEcl and Prior?
 
if ( CurrentDate = CaseStart,
    Abandonment[Inv,StartToECL],
    AbdnCurrentDol[Prior]
)
 
I'm able to color CurrentDate, as it has white space on either side of it. CaseStart, isn't found though.
 
if I use \W or \w or \b, I get the entire line color coded. I only want the token itself colored. How can I accomplish this?
 
lx.Add(new Lexem
                {
                    StartText = @"\WPrior\W",
                    IsRegex = true,
                    ContainsEndText = false,
                    IsMultiline = false,
                    LexemType = EditTokenType.Keyword,
                    FormatName = "KeywordFormat"
                });
 
 
 

Marty Honea
Replied On January 24, 2013 05:12 PM UTC

Ok, I've found the Regular Expression that should work.
 
According to this link
 
Lookbacks and Lookforwards are what I was missing.
 
So I created the Regex (?<=\W)Inv+(?=\W)|Inv
This works, in a way. It finds Inv in the formula. But it also highlights the entire row instead of just the match I'm looking for.
 
How can I make it only highlight the match?

Marty Honea
Replied On January 28, 2013 06:50 PM UTC

For anyone else who's searching this forum with this issue, I've created an Incident with SyncFusion and gotten confirmation that this is indeed broken. They'll be correcting it in a future release.

Antony Xavier D [Syncfusion]
Replied On February 4, 2013 12:16 PM UTC

Hi Marty,

Thanks for your update.

Regarding the patch please follow up the incident #103663 for further updates.

Regards,

Antony.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;