Wednesday, June 19, 2013

Useful Regular Expressions for Notepad++

Adding a semicolon to each line where it doesn't end with semicolon

Adding a particular line before each line

Append * to end of each line

Remove * from end of each line

Change MM by dd or dd by MM in a date

Remove C++ comments from the file


Removing the preceding numbers from each line

Removing the lines which do not contain dot (.) character

5 comments:

  1. nice explanation but very complex to understand :)

    ReplyDelete
    Replies
    1. Well, that depends, I find it easy...You must know the basics of regex.
      If you don't know the basics of regex, don't try to understand, simply use it in notepad++ :)

      Delete
  2. Works great - you just saved me a lot of work. Thanks!

    ReplyDelete
    Replies
    1. You can suggest more scenarios, which can be useful. I can add more here...

      This can be really helpful to people who don't know regular expressions.

      Delete
  3. How would delete just the ending semi-colon in this string without disturbing the rest of the string?:
    9;10;2009;Hamilton Bulldogs;Rockford IceHogs;

    Thanks!

    ReplyDelete