0

We follow our own defined coding standard (Hungarian notation) as per our checklist, using Notepad++:

  1. Check that all variables are valid according to Hungarian notation identifier naming convention, and match & highlight invalid Hungarian notation variables syntax:

    String variables should start with s as follows:

    String sTest = null;   
    

    For int it should be i:

    int iCount = 0;  
    

    If there is a variable String Test = null; or a variable int Count = 0; I want to highlight them as they don't start with s and i.

1
  • In the future, please don't cross-post your questions. Ask them on one site, and if they're off topic they will be migrated anyway. Thanks!
    – slhck
    Aug 26, 2012 at 11:15

1 Answer 1

0

I suppose you are looking for a Regular Expression to match (and highlight) all the cases you describe.

  • This Regex will match any String variable initialization that doesn't have the character s in the beginning of its name: String [^s].*?;

  • This Regex will match any int variable initialization that doesn't have the character i in the beginning of its name: int [^i].*?;

  • This Regex combines both of them: String [^s].*?;|int [^i].*?;

    (RegExr Test)

You must log in to answer this question.