Loading ...
Sorry, an error occurred while loading the content.

23755[Clip] Dot matches newline ON or OFF (was Re: Non printing characters.)

Expand Messages
  • kahitch
    Apr 20, 2013

      I'm no regex expert, and don't claim to be, but I cannot use this:

      > ^!Replace "<span[^>]*>(.*?)</span>" >> "<i>$1</i>" R

      Without modifying the spanned aspect every time. The spans I "fix" are each completely different (to each document, not unique, all of them, to each other). In word processing environments, each individual user (every single person) could name that span something completely different, use a different font, and have a different fallback font. Thusly, this span (which as been the subject of this discussion):

      <span style='font-family:"Times New Roman Italic","serif"'>

      Is unique ONLY to this particular document. Next time, it might be:

      <span style='font-family:"Helvetica","sans-serif"'>

      It's never the same information inside the span. In fact, because of the cruft that all the word-processing programs out there put out, I can have to make 3, 4 5 or more passes, because a) the spacing between elements or the text inside the span will be different; b) the name of the span will be different, or c) any number of other things will be different, all simply to do nothing more than simply *italicize text.* And this is in a single document.

      And I cannot simply regex *all* the spans, because some goodly number of the spans--at least half--are legit, and shouldn't be removed or altered. Believe me, if the spans weren't different each and every time, OF COURSE I would create a clip that I could deploy with a click. I do have "actual" clips like that; those that replace curly quotes with straight, Fix apostrophes, etc. But that only works when the material searched for is always the same. In this case, not only is it not "always" the same, it is NEVER the same, and I don't have the luxury of nuking the precisely 3,937 instances of spans in the HTML document when only some 2-300 of them need to be changed.

      And for the other posters: Yes, I've escaped the special characters. Here's a sample paragraph from the copyrighted text I've been working with:

      <p class=BodyA style='margin-bottom:3.0pt;text-align:justify;text-indent:.25in'><span
      style='font-family:"Times New Roman","serif"'>Emory told them about her long
      day -- four photo shoots in three different locations, and one cranky baby who
      threw up on her.  She found time to squeeze in an occasional text with Mason,
      who was bothered by the tone of the Seahawks meeting -- he didn't like to be
      doubted and hated having his divorce thrown in his face.  Wesley said that was
      good news -- it was unlikely Mason would end up there -- but Emory couldn't
      help thinking it was still a possibility.  </span><span style='font-family:
      "Times New Roman Italic","serif"'>How would that work? </span><span
      style='font-family:"Times New Roman","serif"'> </span></p>

      The ONE span with the <span style='font-family:"Times New Roman Italic","serif"'> throughout the document, which occurs some several hundred times, is what I'm trying to change to, very simply, this:

      <i>How would that work? </i>

      But the clip that I have previously pasted here several times, which has previously worked without a hiccup, now does not. I have added the previously discussed bit, to resolve the non-printing characters, and, again, this is the "saved un-clip" that I've been using for two years sans issues, but now seems to have gone utterly wonky for no apparent reason (please infer that the "search" etc, are NOT part of the actual "clip," thank you); only what you see between opening and closing brackets is actually part of what goes in the regex search and replace boxes.

      Search: <italic span>(.*?)</span> Replace: <i>$1</i>

      Thank you. Again.


      --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
      > hitch@... wrote:
      > > I did not realize that what I'd pasted would be unclear to anyone
      > > here. To be clear, in the "search for" field, I used:
      > That's what I assumed. Please accept that using the dialogue is NOT a
      > clip.
      > > When I say that this is a 'clip,' I keep it stored in my clips
      > That one I don't quite get. You use the clipbook to store stuff which
      > you then copy and paste into a dialogue? If you were to write
      > ^!Replace "<span[^>]*>(.*?)</span>" >> "<i>$1</i>" R
      > You could just click on that and be done.
      > > Now, I know that I've got "regex" selected, because it's finding
      > > the FIND. If regex were not selected, it would not be.
      > Yes, agree.
      > > Does anyone have any thoughts? Thank you.
      > I have to think about that one.
      > Axel
    • Show all 16 messages in this topic