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

Replacing bold tags with h3 tags only when on a separate line?

Expand Messages
  • Sharon
    I m trying to write a clip that will replace html bold tags only when they re on their own line, with h3 tags. So, this some text here subhead some
    Message 1 of 4 , Apr 2, 2008
    • 0 Attachment
      I'm trying to write a clip that will replace html bold tags only when
      they're on their own line, with h3 tags. So, this

      some text here
      <b>subhead</b><br>
      some more text

      should be replaced with

      some text here
      <h3>subhead</h3>
      some more text

      but if there's text like this

      here's a sentence with <b>a bold phrase</b> included

      then the <b> tags shouldn't be changed.

      I believe I'm looking for the regular expression

      ^<b>.*</b><br>

      and once I find it, I want to replace the .* with

      ^!InsertHtml <h3>^&</h3>

      but I'm not sure how to combine these commands. Thanks in advance for
      any advice!

      Sharon
    • Axel Berger
      ... Yes exactly: ^!Replace ^ (.*?) $ $1 WRASI Hope it works Axel
      Message 2 of 4 , Apr 2, 2008
      • 0 Attachment
        Sharon wrote:
        > I believe I'm looking for the regular expression
        >
        > ^<b>.*</b><br>

        Yes exactly:

        ^!Replace "^<b>(.*?)</b><br>$" >> "<h3>$1</h3>" WRASI

        Hope it works

        Axel
      • Sharon
        Thanks very much! I m getting an error message closure cannot immediately follow BegOfLine, EndOfLine or another closure. I think that s because I m still on
        Message 3 of 4 , Apr 3, 2008
        • 0 Attachment
          Thanks very much! I'm getting an error message "closure cannot
          immediately follow BegOfLine, EndOfLine or another closure." I think
          that's because I'm still on version 4.95 and I need the improved
          RegExp engine? Guess it's time to upgrade.



          --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
          >
          > Sharon wrote:
          > > I believe I'm looking for the regular expression
          > >
          > > ^<b>.*</b><br>
          >
          > Yes exactly:
          >
          > ^!Replace "^<b>(.*?)</b><br>$" >> "<h3>$1</h3>" WRASI
          >
          > Hope it works
          >
          > Axel
          >
        • Axel Berger
          ... Probably. The most likely reason was that I had made some stupid mistake in my untested jottings, but I just tried it and it worked fine here. I m too much
          Message 4 of 4 , Apr 3, 2008
          • 0 Attachment
            Sharon wrote:
            > Guess it's time to upgrade.

            Probably. The most likely reason was that I had made some stupid mistake
            in my untested jottings, but I just tried it and it worked fine here.
            I'm too much of a newbie to know anything before version 5, so I have no
            idea how to modify the string.

            Axel
          Your message has been successfully submitted and would be delivered to recipients shortly.