Community
    • Login

    How do I replace only the first <br> tag across multiple files?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    25 Posts 5 Posters 4.7k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Scott NielsonS Offline
      Scott Nielson @guy038
      last edited by Scott Nielson

      @guy038 Terrific! You are great! I was sensible enough to figure out that by, “sensible to case” you mean, “case sensitive” and by, “The $0 syntax represents the overall match, so the string <br>, with this exact case” you mean, “The $0 syntax represents the overall match, which is the string <br>, with this exact case”. You must be French. Merci beaucoup for your help! I learnt French some 30 years ago but je ne peux pas parler beaucoup de français simply because I seldom bumped into French speaking people later.

      1 Reply Last reply Reply Quote 1
      • Scott NielsonS Offline
        Scott Nielson @Terry R
        last edited by

        @Terry-R No problem!

        1 Reply Last reply Reply Quote 0
        • Scott NielsonS Offline
          Scott Nielson @Scott Nielson
          last edited by Scott Nielson

          @PeterJones
          @Scott-Nielson said in How do I replace only the first <br> tag across multiple files?:

          @Alan-Kilborn or anyone else. I am doing Edit->Line Operations->Reverse line order, then in the RegEx mode,
          Find: ^[^/]+\K<br> to find the last (which is actually the first since the lines are reversed) <br> tag in each section and Replace: <br>zxcvb,
          Then Find: (?s)(?<=color:black'>)-(.*?) *(?=zxcvb) and Replace: qwerty$1xxx where qwerty and xxx are some HTML codes I wanna add but is there a RegEx that can help me do the needful without the Edit->Line Operations->Reverse line order (to find the first <br> tag in each section)?

          By the above, you should have figured out that I do try to figure out how to do these things. I seek a solution here only if I am unable to figure out what to do and will continue to do so - I ain't too proud to beg. I thank you for the RegEx that helped me find the very first <br> tag - (?s)\A.*?\K<br>
          Thanks again!

          1 Reply Last reply Reply Quote 0
          • Scott NielsonS Offline
            Scott Nielson @PeterJones
            last edited by Scott Nielson

            @PeterJones If you give me a link to check out something or give me a hint, I do check it out but luckily, @guy038 gave me the right solution (spoon feeding as you call it)!

            1 Reply Last reply Reply Quote 0
            • guy038G Online
              guy038
              last edited by guy038

              Hi, @scott-nielson and All,

              A bit off-topic : Yeah, it’s a common mistake when doing translations ! In French, this kind of words are known as “faux amis” words ! Just because :

              • In English, the adjective sensible have the French sense of raisonnable / sensé or pratique

              • In French the adjective sensible have the English sense of sensitive or noticable

              So, I should have used the expression sensitive to case !

              Cheers,

              guy038

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors