find/replace glossary entry break

Everything related to our flagship word processor.
Post Reply
credneb
Posts: 187
Joined: 2007-03-28 07:30:34

find/replace glossary entry break

Post by credneb »

I was editing a glossary file to insert a closing square bracket ] at the end of each entry.

Inserting an opening bracket at the beginning was easy enough by replacing \t with \t[
Selecting a glossary entry break and cmd-E-ing into the Find field gets \f
Replacing \f with ]\f, however, gets a normal page break -- and the glossary is broken.

Using the Normal find dlg and copying the Glossary Entry Break bubble into the replace field worked fine, and the problem was solved.

But is there no way to replace a regular page break with a GEB (working in a glossary file) using PowerFind Pro?

Curiously,

Cliff
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: find/replace glossary entry break

Post by martin »

Hi Cliff: the problem is that all breaks use the same underlying character code (Unicode U+000C; PowerFind Pro "\f") no matter what type they are, be it page breaks, section breaks, or glossary breaks. It's only a special hidden attribute/formatting that differentiates them.

So when using Find & Replace to adjust breaks, a user must be careful with this formatting, eg: turn on "replace attributes". Though for your situation I might have just used a regex look-ahead.
credneb
Posts: 187
Joined: 2007-03-28 07:30:34

Re: find/replace glossary entry break

Post by credneb »

Thank you, Martin.

And now I've finally figured out how to use Capture. (Figured I should Read The Manual before asking you to explain how to write a regex look ahead.)
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: find/replace glossary entry break

Post by martin »

That's great, captures are a super useful tool.

I should say that what regex calls a lookahead is called "FollowedBy" in PowerFind bubble speak. Similarly a regex lookbehind is called "PrecededBy". They basically let you ensure some text/pattern exists adjacent to your match, but does not included that text/pattern in the actual found match/selection. Let us know if you have any questions.
Post Reply