Ellen Meiselman <[email protected]> sez:

>I have a directory that contains many copies of a file set, each in its
>own subfolder. I'd like to search the entire directory for all files
>called "index.htm" and replace the entire contents of each of them. Each
>one begins with "<!--" and ends with "</html>". What's in between may vary
>slightly.
>
>What is the best Grep pattern for this?


Assuming I understand the task conditions correctly, you should be able to
accomplish this by:

a) Setting up a file filter to limit your search to only files of the
desired name, which you can do via the Filter: popup in the Multi-File
Search window, then

b) Performing a Replace All with the "Grep" option enabled with:

Find:     <!--(?s).+</html>

Replace:                      # empty field to delete, or any desired text


As a precaution, I recommend trying this out on some sample files before
using it on the actual file set.


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.                      <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048

-- 
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