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

Syntax coloring program labels

I am trying to syntax color program labels, which for me are simply any alphanumeric followed by a '':'' character. The XML description that I wrote does not match the text properly: The problem appears to be the colon character. Simplifying the definition to try to just match "foo:" does not work. But, matching just a colon character does work. Is there something I am doing wrong? In addition, the regular expressions do not appear to handle beginning-of-line (^) correctly. For example "^foo" will match "foo" anywhere in the line. Is there a workaround for this? Best regards, Ed

4 Replies

EK Ed Kuzemchak - SDS Inc. June 8, 2006 08:37 PM UTC

(For some reason, the XML examples I pasted did not come thru - maybe they are hidden by the HTML page?) I am trying to syntax color program labels, which for me are simply any alphanumeric followed by a '''':'''' character. The XML description that I wrote does not match the text properly:

<\pre>

The problem appears to be the colon character. Simplifying the definition to try to just match "foo:" does not work.


<\pre>



But, matching just a colon character does work.


<\pre>



Is there something I am doing wrong?


In addition, the regular expressions do not appear to handle beginning-of-line (^) correctly. For example "^foo" will match "foo" anywhere in the line. Is there a workaround for this?

Best regards,
Ed
  
            


EK Ed Kuzemchak - SDS Inc. June 8, 2006 08:40 PM UTC

OK - it seems to not be possible to type XML in the Forum. Nice. Could someone suggest a lexem definition to match labels that end with a colon char. What I expected to work "^\s*w+:" does not for the reasons below.


AD Administrator Syncfusion Team June 9, 2006 01:19 PM UTC

Hi Ed, Our apologies for the inconvenience caused.I have attached a sample that illustrates how to apply syntax highlighting for labels that end with a colon character. We have considered adding support to highlight lexems if they only occur at the beginning of the lines and have logged a feature request# 524 on this.You could track the progress of this feature request at this link below : Feature Request #524 - Support to highlight lexems if they only occur at the beginning of the lines Let me know if this meets your requirements. Regards, Ebenezer.P

RegularExpression1.zip


EK Ed Kuzemchak - SDS Inc. June 13, 2006 03:01 PM UTC

Thanks! That worked for me. Looking forward to the additional capability of including begin/end line in the regular expression. But this will work for now. Ed >Hi Ed, > >Our apologies for the inconvenience caused.I have attached a sample that illustrates how to apply syntax highlighting for labels that end with a colon character. > >We have considered adding support to highlight lexems if they only occur at the beginning of the lines and have logged a feature request# 524 on this.You could track the progress of this feature request at this link below : > >Feature Request #524 - Support to highlight lexems if they only occur at the beginning of the lines > >Let me know if this meets your requirements. > >Regards, >Ebenezer.P > >

RegularExpression1.zip

Loader.
Live Chat Icon For mobile
Up arrow icon