Notepad++ Logo

Notepad++ Tips N Tricks for Coding – Regex (Regular Expressions)

posted in: Technology | 0

So many things that Notepad++ can do and it took me a while to discover the tools and tricks to help do things faster. This is MY list of tips but wanted to share. Yes, there are many ways to do things but this is what worked for me.

RegExp Find and Replace Text

  1. Start at the top of the document (RegExp replace doesnt seem to go backwards very well
  2. Click Search -> Replace

Replace Hyperlinks, Anchors but keep the text

  • Find what = (?s)<a .*?>(.*?)</a>
  • Replace with = $1
  • mode = regular expression

Remove all HTML tags but keep text

  • Find what: <(.|\n)*?>
  • Replace: leave blank
  • mode = regular expression

Extract the Text from a select dropdown

  • Find what = (?s)<option .*?>(.*?)</option>
  • Replace with = $1
  • mode = regular expression