Many thanks to Patrick Woolsey and Fletcher Sandbeck for their contributions (especially for reminding me that the repetition quantifiers can match line breaks).
I suddenly realised that my expression should have been using ‘at least 1’ rather than ‘0 or more’ at a couple of places. Here is my new version, which appears to work: ^([^'\r\n]+'[^'\r\n]+')*[^'\r\n]*'[^'\r\n]*$ Hmmm, I’m glad I don’t have to figure what that does. Thanks everyone. Thomas Green 73 Huntington Rd, York YO31 8RL, UK 01904-673675 mob. 0794 700 2581 > On 27 Sep 2018, at 16:19, Patrick Woolsey <[email protected]> wrote: > > On 9/27/18 at 7:14 AM, [email protected] (Thomas Green) wrote: > >> I need to find all lines that contain an odd number of single straight >> quotes, such as >> >> full_title: '_Acteon's Cantate Burlesque_' > > Is there any bound on how many single quotes a line can contain? > > Absent that, Fletcher's suggestion (or some similar context-dependent > condition) is likely your best bet. > > >> [...] That surprised me, I thought the * character didn't match /r or /n. > > For reference, it's the . 'any character' metacharacter which doesn't match > line breaks by default, not the repetition quantifiers * + ? > > > Regards, > > Patrick Woolsey > == > Bare Bones Software, Inc. <http://www.barebones.com/> > > -- > This is the BBEdit Talk public discussion group. If you have a feature > request or need technical support, please email > "[email protected]" rather than posting to the group. > Follow @bbedit on Twitter: <https://www.twitter.com/bbedit> > --- You received this message because you are subscribed to the Google Groups > "BBEdit Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/bbedit. -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <https://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
