Community
    • Login

    Replacing words with my own abbreviations in a list of fixtures

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 2.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.
    • Gary BarnesG Offline
      Gary Barnes
      last edited by

      Hello.
      I run a football forum and would like to replace some football club names with abbreviated names of my choice.
      For example, here is a typical list of fixtures which I might paste into Notepad ++
      Manchester United v Nottingham Forest
      Queens Park Rangers v Newcastle United
      Sheffield Wednesday v Sheffield United
      Manchester City v Milton Keynes Dons

      I want to change the fixtures to this:
      Man Utd v Nottm Forest
      QPR v Newcastle
      Sheff Wed v Sheff Utd
      Man City v MK Dons

      Thank you.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Gary Barnes
        last edited by

        @Gary-Barnes

        I assume you do not want to do 8 single replaces therefore
        I recommend using regular expressions and a technique
        as described by @guy038 here.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • Gary BarnesG Offline
          Gary Barnes
          last edited by

          Dear Claudia,
          thank you for your help. Unfortunately, I do not understand the explanation described by guy038.
          I was hoping I could enter words in the find box, like Manchester United, Sheffield Wednesday, etc, and in the replace box, Man Utd, Sheff Wed, etc.
          I wrongly believed that the words entered in the find box and then in the replace box could be separated by a common symbol, like a comma or forward slash.
          If you or another member would be kind enough to show me exactly how to enter the information in the find and replace boxes using football teams as described in my first post, I will be extremely grateful.

          Thank you.

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank @Gary Barnes
            last edited by Claudia Frank

            @Gary-Barnes

            No, you cannot just provide a list. You need to use regex. I did it for 3 teams, I guess you can add
            the rest yourself.

            Find what:(?-i)\b(?:(Manchester United)|(Nottingham Forest)|(Queens Park Rangers))\b
            Replace with:(?1Man Utd)(?2Nottm Forest)(?3QPR)
            

            more info about regex: http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 1
            • Gary BarnesG Offline
              Gary Barnes
              last edited by

              Thank you so much!

              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