I have a list like following:

hrthrhthrht
bntyjhytjtyj
8,083,344
Mar1996
tggrgge

Now I need a notepad++ regex that bookmark two following lines:

8,083,344
Mar1996

this mean two consecutive lines that first line start with a digit and second line include only a date or following regex:

b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b

I tried following regular expressions but not worked for me:

^[^drn]*(?:D*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4})[^drn]*$

^[^drn]*(?:D*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4})[^drn]*R[^drn]*(?:D*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4})[^drn]*$

^[^drn]*(?:D*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4})[^drn]*R[^drn]*(?:D*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4})[^drn]*$

^[^drn].*Rb(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b.*$

^[^drn].*R^[^drn].*b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b.*$

^[^drn].*R[^drn].*b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b.*$

^[^drn].*R^[^drn].*b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b

^[^drn].*R[^drn].*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}b

where is problem?
note that first line should start with a digit.

You may use this regex to match 2 consecutive lines as desired:

^d+(?:,d+)*r?n[^drn]*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)d{4}[^drn]*$

RegEx Demo

RegEx Details:

  • ^: Line Start
  • d+(?:,d+)*: Match 1+ digits then match 0 or more sets of comma followed by 1+ digits
  • r?n: Match a line break
  • [^drn]*: Match 0 or more of any character that are not a digit and not a line break
  • (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec): Match month string
  • d{4}: Match 4 digits
  • [^drn]*: Match 0 or more of any character that are not a digit and not a line break
  • $: Line End