AmVerse Tip #5: Bracketing spans of page numbers

If a number of pages in the book have no printed page number, you can use the following search-and- replace strings in Author/Editor to add brackets around the "N" attribute values of the tags. This saves you having to open the attributes window for each <PB> and inserting the brackets by hand.

You can run this replacement interactively: that is, FIND one page number, REPLACE it; FIND the next, REPLACE it, and so on.

With "Find patterns" checked (under options) and "Case sensitive" unchecked,

replace this: <PB N="([0-9ivxlc]+)"

with this: <PB N="[\1]"

This translates as: "search for <PB> tags that contain an "N" attribute value consisting of some combination of one or more of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, i, v, x, l, c, save that value as VARIABLE-1, and replace it by VARIABLE-1 inside a pair of square brackets."

The same technique can be used to make changes in other attribute values.

(You should be able to do something similar in TextPad by using the replace feature with "Regular expression" checked. Replace this:

<PB\([^>]*\) N="\([^"]+\)"

with this: <PB\1 N="[\2]"

or this:

<PB\([^>]*\) N="\([0-9ivxlc]+\)"

with this: <PB\1 N="[\2]"

A/E is a little easier than TextPad in this case because it "knows" about attributes and is able to ignore the other attributes in the <PB> tag other than the one you want to change. TextPad knows only about character strings, so with it you need to match any intervening attributes and ensure that they are retained.)