Far from being an expert but this looks amenable to GREP searching/replace.

Is there a way to regularly identify the first occurrence in each file? What comes immediately before it?

Cheers,

J

On 7 May 2026, at 14:29, Neil Faiman wrote:

Well, at least I read the fine manual and saved myself the humiliation of publicly asking whether there was a way to selectively search in the set of files that matched a previous multi-file search. (Of course there is. Just select the previous search results from the “Results Browsers” list in the “Search in:” chooser.)

But I couldn’t find this one in the manual. I have a bunch of HTML files. Some of them have multiple <section> elements. I want to add a property to the first <section> tag in each file. I.e., before

<section>
    some content
    <section>
        inner content
    </section>
</section>
<section>
    more content
</section>

and after:

<section id=“main_content">
    some content
    <section>
        inner content
    </section>
</section>
<section>
    more content
</section>

But the only choices seem to be replace al or replace none. Is there a clever hack to solve this (or better, another feature I’ve overlooked?

Thanks,
Neil Faiman

--
This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "[email protected]" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@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 view this discussion visit https://groups.google.com/d/msgid/bbedit/0E76497B-0BB8-4AB2-A2B2-C595E261F46F%40faiman.org.



https://orcid.org/0000-0002-7213-2147

Davies, J. P. (2025). [Landscapes of Liminality: Towards a Map](https://pressbooks.bccampus.ca/thresholdconceptsconference/chapter/landscapes-of-liminality-towards-a-map/). In A. S. Webb (Ed.), 2025 [*New Horizons in Threshold Concepts (Vancouver B.C.)*](https://pressbooks.bccampus.ca/thresholdconceptsconference/).

Davies, J. P. et al (eds.). (2024). [*Threshold Concepts in the Moment*](https://doi.org/10.1163/9789004680661). Brill.

Mosurinjon S., Davies. J. P. (2024) ['Secularism as a Universalising Threshold Concept'](https://doi.org/10.1163/9789004680661_006) in Davies et al (2024), 72--85.

--
This is the BBEdit Talk public discussion group. If you have a feature request or believe that 
the application isn't working correctly, please email "[email protected]" rather 
than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@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 view this discussion visit 
https://groups.google.com/d/msgid/bbedit/77E5ACF8-20F6-4A00-A032-FE6BAB39F7FE%40gmail.com.

Reply via email to