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.

migrated from askubuntu.com Aug 26 '12 at 11:09

This question came from our site for Ubuntu users and developers.

  • 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 '12 at 11:15
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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy