On Oct 04, 2018, at 01:39, F. Alfredo Rego <f.alfredor...@gmail.com> wrote:
> 
> Dear regex gurus,
> 
> I have many files that contain text like this and I would like to select 
> entire blocks for which I have created home-brewed “delimiters” (such as 
> “Block_begin” and “Block_end”). These delimiters, of course, can be any 
> metadata that I don’t use as data, so this is just one specific example that 
> I use for expressions that contain “_debug_”:
> 
[...]

Though it's hard to be sure without testing against actual data :-), I suggest 
you try this:

Find:   {.+?Block_begin(?s).+?Block_end

and adjust if need be.

This pattern starts by matching a literal left curly bracket { followed by one 
or more instances of any character .+ _non-greedily_ ? up to the literal string 
"Block_begin", then uses the modifier (?s) to allow . to match line breaks and 
again performs a _non-greedy_ search for one or more instances of any character 
.+? -- this time across line breaks if necessary -- until it matches the 
literal string "Block_end" and that's all, folks. ;-)


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
"supp...@barebones.com" 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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to