On Mon, Jul 18, 2011 at 05:02:00PM -0700, Semper Fidelis wrote:

> If you literally mean "(?s)^Note:.*?(?=^RULE)", then you could achieve
> the effect you want by escaping all the regex characters in BBEdit's
> "Search for: field, then surround the whole thing with matching
> parentheses, as follows ...
> 
> (\(\⌀?s\)\^Note:\.\*\?\(\?=\^RULE\))
> 
> ... and then in the "Replace With:" field specify ...
> 
> \t\1
> 
> ... to prepend a tab in front of your escaped regex phrase, wherever that
> phrase may occur in your document.

That won't work in this case; he's searching for multi-line text.

I haven't used text factories, but this is how I would do it in Perl:

#!perl

local $/;

while (<>) {
  s{^(Note:.*?)(?=^RULE)}{ my $x = $1; $x =~ s,^,\t,gm; $x }smge;
  print;
}

__END__

I assume you'd do something similar in a text factory; do a search for a
block of text, do a search & replace within that block of text, and then
insert the result back into the file.

Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to