Reputation: 990
Does anyone know how to search something like this in the search box of Notepad++ ?
ID. 213
Debt: 13 $
I want this to be searched like :
"ID. (don'care for the number/any character),newline, Debt(don'care for the number/any character)"
Upvotes: 8
Views: 43028
Reputation: 91385
How about:
ID\..*?Debt:
Don't forget to enable . matches newline
explanation:
(?^:ID\..*?Debt:)
The regular expression:
(?-imsx:ID\..*?Debt:)
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
ID 'ID'
----------------------------------------------------------------------
\. '.'
----------------------------------------------------------------------
.*? any character including \n (0 or more times
(matching the least amount possible))
----------------------------------------------------------------------
Debt: 'Debt:'
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
Upvotes: 1
Reputation: 1883
Turn on regular expression mode in Find, with ". matches newline
" enabled:
Search for:
ID\.\s.*[\n]+Debt:\s.*$
Older versions of Notepad++ have difficulty matching multi-line regexes, be sure to have version 6+ Notepad++ for this to work.
Upvotes: 6