Monday, May 31, 2021

Matching an empty line with regular expression string match

 
 
works in regular expression search mode in notepad++
 
^\s*$

Explanation:

  • ^ is the beginning of string anchor.
  • $ is the end of string anchor.
  • \s is the whitespace character class.
  • * is zero-or-more repetition of.

In multiline mode, ^ and $ also match the beginning and end of the line.

 
 
--30--
 
 
 

No comments:

Post a Comment