<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Don't get me wrong. I'm not saying that it wouldn't be *useful* to be able to insert a new EOP. But the reality is that in either Word or FrameMaker (and I assume in other word processing applications) it is problematic because EOP is not a simple character. Regular expressions are designed to work with arbitrary strings of simple characters. They were never intended to handle characters that have formatting or page layout properties embedded in them. If a regular expression *were* able to insert a new EOP, what formatting should apply to it? Since regular expressions don't know about formatting, the only practical answer is the lowest level default formatting. But in any properly designed word processor document (i.e., one that uses styles) that default is going to be *wrong* in >99% of cases and require further, manual attention from the author, which really defeats the benefit of being able to use a regular expression replacement. A simple text editor is a completely different situation because there really is nothing special about an EOP. <br><br>I think the real point is that in Klaus' case the analysis of the task was slightly flawed. To fix his punctuation issue, what he really wants to do is insert a period (full stop) between the current unpunctuated text and the existing EOP, which is exactly what his second regular expression does. There really is no reason to delete the existing EOP (and all the "magic" embedded in it) and replace it with a brand-new, untagged EOP that would require his manual attention to tag and/or format. FrameMaker's behavior of not allowing this saves the user from having to do a lot of after-the-fact cleanup. <br><br>FrameMaker's regular expressions let you find EOPs without issue, and lets you reuse them. What they don't let you do is try to create a new one where there is insufficient information in the found text string(s) to do that operation without making a mess.<br><br>-Fred<br><br><div><hr id="stopSpelling">From: Syed.Hosain@aeris.net<br>To: docudoc@hotmail.com; frame@daube.ch; framers@lists.frameusers.com<br>Date: Mon, 7 Jul 2014 09:10:33 -0700<br>Subject: RE: FM12: Quirks in Find/replace using RegEx (Perl)<br><br><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:#0563C1;
text-decoration:underline;
}
.ExternalClass span.ecxMsoHyperlinkFollowed {
color:#954F72;
text-decoration:underline;
}
.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass span.ecxEmailStyle18 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}
.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}
.ExternalClass div.ecxWordSection1 {
}
--></style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Hi, Fred.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Hmmm
I understand your point, but am not sure I would <i>entirely</i> agree with the reasoning. </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Yes, FrameMaker (and other programs like Word) do put in additional information besides the EOP glyph itself.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"><br>But, this is a relatively commonly used/desired function certainly in simple text editors to replace an EOP with other characters (perhaps including an EOP). For example, to join multiple lines together, or to do what Klaus mentions.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Yes, FM is <i>not</i> just a simple text editor, which is why I see your reasoning to not call it a bug.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">But I think it would be good to define exactly what regular expression matching is supposed to do with EOP markers then (or have a special mechanism to identify <i>and</i> use an EOP more effectively perhaps?)</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Z</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><div><div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in;"><p class="ecxMsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";"> framers-bounces@lists.frameusers.com [mailto:framers-bounces@lists.frameusers.com] <b>On Behalf Of </b>Fred Ridder<br><b>Sent:</b> Monday, July 07, 2014 8:02 AM<br><b>To:</b> frame@daube.ch; framers@lists.frameusers.com<br><b>Subject:</b> RE: FM12: Quirks in Find/replace using RegEx (Perl)</span></p></div></div><p class="ecxMsoNormal"> </p><div><p class="ecxMsoNormal" style=""><span style="font-family:"Calibri","sans-serif";">No, I don't think it is a bug. <br>And end-of-paragraph mark is not a simple glyph; it has properties and attributes associated with it (e.g. a paragraph tag, the formatting associated with that paragraph tag, and any overrides to the standard formatting for the tag). <br>You can find an EOP as if it were a simple glyph because they do have a common fundamental property (i.e. denoting the end of a paragraph). <br>But you cannot effectively insert a new EOP in a replace string because there is no way to associate any of the other properties with the new mark. <br>Finding an EOP and replacing it with itself, on the other hand, is a valid operation because the found mark has a full complement of paragraph properties.<br><br>-Fred Ridder</span></p><div><p class="ecxMsoNormal"><span style="font-family:"Calibri","sans-serif";">> From: <a href="mailto:frame@daube.ch">frame@daube.ch</a><br>> To: <a href="mailto:framers@lists.frameusers.com">framers@lists.frameusers.com</a><br>> Date: Mon, 7 Jul 2014 15:48:17 +0200<br>> Subject: FM12: Quirks in Find/replace using RegEx (Perl)<br>> <br>> Friends of FramMaker, please judge.<br>> <br>> I want to find incorrectly ended paragraphs (missing punctuation).<br>> For example the following 4 lines are paragraphs, the first 2 correct,<br>> the next two incorrect:<br>> <br>> This is the first paragraph!<br>> And this is the second one.<br>> And here a third<br>> And a fourth one:<br>> <br>> RegEx Find/Replace with these settings:<br>> Find: ([^\.!?])\n<br>> Repl: $1.\n<br>> Result: find is correct, replacement is n instead of paragraph end<br>> With repl = $1.\r replacement is a forced newline; correct, but not wanted.<br>> <br>> Find: ([^\.!?])(\n)<br>> Repl: $1.$2<br>> This creates a correct replacement!<br>> <br>> IMHO the behaviour of not honoring \n as an 'end of paragraph' for the replacement is <br>> a bug. Do You agree?<br>> <br>> Klaus Daube</span></p></div></div></div></div> </div></body>
</html>