Suppose you have an HTML file that has URLs in its body text that are not clickable. You want to make them clickable by placing the URLs inside anchor tags. But like any other HTML file, your file also has URLs as part of anchors (links), images, and other tags. Those URLs should be left alone. You also want to ignore URLs that have already been placed inside anchor tags.
When PowerGREP executes this action, it first uses the file sectioning regex to match all the anchor tags with their contents, and all other HTML tags without contents. Because we put the anchor tag regex first in the list, it takes precedence over the HTML tag regex. At a position where both regexes can match, only the first one will. With “non-overlapping search” turned on, searching for the list of regular expressions one and two (in that order) is exactly the same as searching for the single regex one|two. A list of multiple short regexes is easier to manage than a long regex with many alternatives. But there’s no functional difference.
Because “file sectioning” is set to “split along delimiters”, PowerGREP treats the matches of the file sectioning regexes as delimiters that chop the file into pieces. The action’s search-and-replace separately processes each bit of text between two delimiters (and before the first and after the last delimiter). In this case, the search-and-replace works on each bit of text between two HTML tags, between two anchor tags (with contents), or between an anchor tag and another HTML tag. Essentially, the search-and-replace skips over all anchor tags (with contents) and all HTML tags.
You can find this action in the PowerGREP5.pgl standard library as “Put anchors around URLs that are not already inside a tag”.