FM12: Quirks in Find/replace using RegEx (Perl)

Scott Prentice sp10 at leximation.com
Mon Jul 7 09:11:45 PDT 2014


Hi Klaus...

Definitely a bug in that the handling of "\n" is inconsistent. But I'd 
wonder what "\n" is really matching on, and what type of "end of line" 
is it? Will this match on a forced return (SHIFT+ENTER) as well as an 
end of paragraph? And what about the end of flow? I'd feel better if 
"\n" didn't match on anything since I don't know that this really 
applies in a FM document. What about trying "$" to indicate an end of line?

Definitely a bug though.

...scott

On 7/7/14 6:48 AM, Klaus Daube wrote:
> Friends of FramMaker, please judge.
>
> I want to find incorrectly ended paragraphs (missing punctuation).
> For example the following 4 lines are paragraphs, the first 2 correct,
> the next two incorrect:
>
> This is the first paragraph!
> And this is the second one.
> And here a third
> And a fourth one:
>
> RegEx Find/Replace with these settings:
> Find:  ([^\.!?])\n
> Repl:  $1.\n
> Result: find is correct, replacement is n instead of paragraph end
> With repl = $1.\r        replacement is a forced newline; correct, but not wanted.
>
> Find:  ([^\.!?])(\n)
> Repl:  $1.$2
> This creates a correct replacement!
>
> IMHO the behaviour of not honoring \n as an 'end of paragraph' for the replacement is
> a bug. Do You agree?
>
> Klaus Daube
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Docu + Design Daube; Schäracher 11; CH-8053 Zürich
> Technical documentation & consultancy; On-line and paper
> F: +41-44-422 86 25  E: ddd at daube.ch  W: www.daube.ch
>
> _______________________________________________
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frameusers.com/pipermail/framers-frameusers.com/attachments/20140707/f0e59abe/attachment.htm>


More information about the framers mailing list