Page 1 of 1

Congratulations AND PowerFind Feature Requests

Posted: 2007-07-09 11:44:52
by rcgordon
Congratulations on releasing NW Pro. I've found and reported at least one bug with attribute-sensitive Find/Replace, but the prognosis is good.

A couple things though: Nisus's PowerFind Pro implementation has fallen seriously behind the times in terms of standard regular expression support. At the very least, you should support for positive and negative lookahead/lookbehind. Even in NW Classic, positive lookahead/lookbehind was supported (using different syntax, but with the functionality intact). That is, in modern regex, the (?= ... ), (?<! ... ), (?<= ... ), and (?! ... ). The first two are roughly equivalent to NW Classic' :> and :< operators.

Also, there is no functional \A or \Z for accessing the beginning and end of document, though that can be gotten around more easily. Those are the two biggest ommisions in the current PowerFind, although there are others, which are supported by all the other text processors that handle regular expressions and even Adobe InDesign CS3 (whose regex support is actually superb).

Posted: 2007-07-09 16:27:04
by martin
While we don't support lookbehind, you should find that positive and negative lookahead work properly, eg: "(?=text)" and "(?!text)". I will note that we are looking into the possibility of replacing our regex engine in a future release to increase its capabilities.

As for "\A" and "\Z", the latter should work properly. It looks like there is a problem with "\A" though- I'll file a bug, thanks.

Posted: 2007-07-10 16:33:19
by greenmorpher
Hello Martin

Kino on the Dartmouth list pointed this out as one of the problems (along with no access to check the dictionary) of writing a quality macro to find capitalization errors at the beginning of sentences (see the thread "capitalization"). You need "look behind" to cut out false positives such as abbreviations.

In this special case, Philip Spaelti suggested a workaround:

'On a first past look for all abbreviations and then "shield" those periods with a character (e.g. a backslash, so "e.g." becomes "e.g.\"). After you fix the capitalization, another pass is needed to remove the "shield" characters.'

The abbreviations would still need to be listed in the macro because the macro wouldn't be able to access the dictionary to find the abbreviations there, unfortunately, but such a scheme would be a step closer.

It might work in some other instances where look behind was needed too.

Cheers, Geoff

Geoffrey Heard, Business Writer & Publisher

"Type & Layout: Are you communicating or just making pretty shapes" -- Revealed! The secrets of how you can use type and layout to turbocharge your messages in print. See the book at http://www.worsleypress.com

Posted: 2007-07-10 19:17:18
by ssampler
Isn't lookbehind available in NWP via Perl?

-Steve

Posted: 2007-07-10 19:21:22
by rcgordon
Lookbehind may be available within Perl, but Perl doesn't offer access to the even more important features (to my workflow) of attribute-sensitive PowerFind Pro.