We have many HTML file with many special unordered lists <ul class="container"> and want to change the <li> elements in just those lists to <li class="vertical divider">. So, this involves finding the multi-line block of text constituting the list, and replacing the <li> tags.
I tried grepping a list into 5 chunks: 1) the <ul class="container"> string, 2) everything between the <ul> and the next plain <li>, 3) the plain <li>, 4) everything between the <li> and the closing </ul>, 5) the closing </ul>. So, the FIND string looks like: (<ul class="container">)((?s).*?)(<li>)((?s).*?)(<ul>) The round-parentheses delimit the 5 chunks, the .*? is a non-greedy string match, and the (?s) flag includes carriage returns in the dot-everything search. The intended REPLACE string looks like: \1\2<li class="vertical-divider">\4\5 This brackets the new middle (3rd) chunk with the original 1st+second and 4th+5th chunk. However, the FIND selects everything to the end-of-file after the <ul class="container">, despite the non-greedy (?s).*? syntax. How else to do this? -- 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 bbedit@googlegroups.com. Visit this group at https://groups.google.com/group/bbedit.