• Login
Community
  • Login

Replacing words with my own abbreviations in a list of fixtures

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 2.3k Views
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.
  • G
    Gary Barnes
    last edited by Jul 22, 2017, 1:39 PM

    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.

    C 1 Reply Last reply Jul 22, 2017, 3:00 PM Reply Quote 0
    • C
      Claudia Frank @Gary Barnes
      last edited by Jul 22, 2017, 3:00 PM

      @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
      • G
        Gary Barnes
        last edited by Jul 22, 2017, 4:57 PM

        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.

        C 1 Reply Last reply Jul 22, 2017, 5:08 PM Reply Quote 0
        • C
          Claudia Frank @Gary Barnes
          last edited by Claudia Frank Jul 22, 2017, 5:11 PM Jul 22, 2017, 5:08 PM

          @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
          • G
            Gary Barnes
            last edited by Jul 22, 2017, 5:25 PM

            Thank you so much!

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors