Page 1 of 1

Match beginning/end of line

PostPosted: Fri Dec 29, 2023 7:32 pm
by jandamm
I want to match a date in the contents of a file and there should be no text behind the date in the line.

I've tried to get it to work but haven't found a way and also didn't find anything in the guide or forum.

Given this content of a file:
Code: Select all
hello 12.12.23 text
13.12.23
Another line
14.12.23

I want to match the 13th but cannot use 2nd match since this might differ.
The best detection is that the date is the only content in the line.

So using RegEx I'd match `^\d{2}.\d{2}.\d{2}$` but I cannot find the equivalents for ^ and $.

Re: Match beginning/end of line

PostPosted: Tue Jan 02, 2024 10:42 am
by Mr_Noodle
Is the text on the previous or following line consistent?