How to detect syntax and change the colour of the string using regex RRS feed

  • Question

  • Hi guys I'm new to visual basics & started learning it today. I've created a notepad using Rich Text Box. What i want to do now is to integrate regex to highlight the syntax of the strings that are entered continuously (like in notepad++ & programmer's notepad). The string would contain only words and numbers. I want the words to be displayed in blue colour and the numbers in red. Please guide me.

    one more question..when i'm trying to import regex, it shows syntax error..how do i get to setup regex ???

    I've searched regarding this but nothin has been explained in detail. Pardon me for being a noob.

    • Moved by eryang Monday, February 14, 2011 8:17 AM (From:Regular Expressions)
    Wednesday, February 2, 2011 10:43 PM

All replies




    Thank you for your post, but your question is more like a VB issue, so you can try the question at VB forums; Microsoft forums support current releases of Visual Basic as well as help on migration to the .NET platform through the following forums:

    Visual Basic Interop and Upgrade (Update VB6 code to .NET)

    Visual Basic General (General VB.NET questions)

    Visual Basic Power Packs (controls, components, samples and tools that are part of the VB Power Packs)

    Visual Basic Language (VB.NET language -- compiler, runtime, language keywords)

    Visual Basic IDE (IntelliSense, debugging, ErrorCorrect, code snippets, colorization, smart tags, etc.)
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:

    VB Forums

    VB City

    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 3, 2011 5:32 AM