Apparent regex bug involving `\_.' (and other newline-matching constructs)

2015-12-27 Thread Brett Stahlman
Given a file containing the following 2 lines... 1a3 123xyz ...try the following tests, and note the unexpected results. Case 1.1: call cursor(1, 1) echo searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW') => [1, 1, 2] Case 1.2: call cursor(1, 2) echo searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW') =>

Re: Apparent regex bug involving `\_.' (and other newline-matching constructs)

2015-12-28 Thread Bram Moolenaar
Brett Stahlman wrote: > Given a file containing the following 2 lines... > 1a3 > 123xyz > > ...try the following tests, and note the unexpected results. > > Case 1.1: > call cursor(1, 1) > echo searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW') > => [1, 1, 2] > > Case 1.2: > call cursor(1, 2) > ec

Re: Apparent regex bug involving `\_.' (and other newline-matching constructs)

2015-12-28 Thread Brett Stahlman
On Mon, Dec 28, 2015 at 6:20 AM, Bram Moolenaar wrote: > > > Brett Stahlman wrote: > > > Given a file containing the following 2 lines... > > 1a3 > > 123xyz > > > > ...try the following tests, and note the unexpected results. > > > > Case 1.1: > > call cursor(1, 1) > > echo searchpos('\%(\([a-z]\)

Re: Apparent regex bug involving `\_.' (and other newline-matching constructs)

2015-12-28 Thread Bram Moolenaar
Brett Stahlman wrote: > > > Given a file containing the following 2 lines... > > > 1a3 > > > 123xyz > > > > > > ...try the following tests, and note the unexpected results. > > > > > > Case 1.1: > > > call cursor(1, 1) > > > echo searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW') > > > => [1, 1, 2] >

Re: Apparent regex bug involving `\_.' (and other newline-matching constructs)

2015-12-28 Thread Brett Stahlman
On Mon, Dec 28, 2015 at 12:20 PM, Bram Moolenaar wrote: > > Brett Stahlman wrote: > >> > > Given a file containing the following 2 lines... >> > > 1a3 >> > > 123xyz >> > > >> > > ...try the following tests, and note the unexpected results. >> > > >> > > Case 1.1: >> > > call cursor(1, 1) >> > > ec