Page 1 of 1

How to match two lines separated by newline?

PostPosted: Tue Oct 04, 2022 4:44 am
by halloleo
I have a PDF whose textual representation (according to the rules preview) contains the two lines

Code: Select all
...
 1 Mar 21
 28 Mar 21
...

I can match the individual lines, but I don't know how to match the two lines with the newline in between.

Also, each date seems to start always on the second column of the line (note the space before 1 Mar 21). Can I somehow say in a match: "Match from the beginning of the line a space and then my custom text"?

Thanks for pointers! :)

Re: How to match two lines separated by newline?

PostPosted: Tue Oct 04, 2022 9:19 am
by Mr_Noodle
If you enter a space in to a pattern, it will match any amount of space or newlines.

Re: How to match two lines separated by newline?

PostPosted: Tue Oct 04, 2022 3:57 pm
by halloleo
Mr_Noodle wrote:If you enter a space in to a pattern, it will match any amount of space or newlines.


Thanks Paul.

To find with more certainty the intended match, is there a way to specify to match only newlines and not other whitespace?

Re: How to match two lines separated by newline?

PostPosted: Wed Oct 05, 2022 9:57 am
by Mr_Noodle
Not really. Is that really needed in this case? You can try matching a specific occurrence if it's something that occurs multiple times in the file. Or match the line before and/or after to include more context.