Re: Search for pattern in the first few lines of a buffer

2021-06-21 Thread Lifepillar
On 2021-06-21, Yegappan Lakshmanan wrote: > Hi, > > On Sun, Jun 20, 2021 at 3:59 AM Lifepillar wrote: >> >> I need to programmatically search for a pattern in the first ten lines >> of a given buffer, and save the match in a variable when found. Say, the >> pattern is: >> >> % KEY = value >>

Re: Search for pattern in the first few lines of a buffer

2021-06-20 Thread Yegappan Lakshmanan
Hi, On Sun, Jun 20, 2021 at 3:59 AM Lifepillar wrote: > > I need to programmatically search for a pattern in the first ten lines > of a given buffer, and save the match in a variable when found. Say, the > pattern is: > > % KEY = value > > I need to extract the value if the above appears in

Search for pattern in the first few lines of a buffer

2021-06-20 Thread Lifepillar
I need to programmatically search for a pattern in the first ten lines of a given buffer, and save the match in a variable when found. Say, the pattern is: % KEY = value I need to extract the value if the above appears in the first lines of the buffer. Of course, the state of the buffer's