How about ^#define or, if some might be indented, ^\h*#define Positional assertions are great, but why use them if you don't have to, especially look-behinds, which can't have variable string lengths?
On Sunday, April 15, 2018 at 6:35:59 PM UTC-4, Alfredo wrote: > > I’m trying to find all “enabled” defines such as this: > > #define _some_enabled_define_ > > while excluding all “disabled” (commented) defines such as this: > > // #define _some_disabled_define_ > > > This regular expression causes BBEdit to include both of the above kinds > of defines (“enabled” defines and “disabled” (commented) defines) in the > search results: > > (?<!//)#define > > As far as I believe, the forward slash is not a special character, but I > tried escaping it anyway: > > (?<!\/\/)#define > > Same results. > > > To test whether macOS supports a negative look-behind assertion, I tried > an obviously incorrect regular expression and got a reassuring error > message which tells me that, at least, the syntax for the negative > look-behind assertion is checked correctly: > > > > > > Am I missing something? Any clues? > > Thanks. > > Alfredo > > -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "supp...@barebones.com" rather than posting to the group. Follow @bbedit on Twitter: <http://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 bbedit+unsubscr...@googlegroups.com. To post to this group, send email to firstname.lastname@example.org. Visit this group at https://groups.google.com/group/bbedit.