• Login
Community
  • Login

How to remove text after specific characters from each line?

Scheduled Pinned Locked Moved General Discussion
3 Posts 3 Posters 15.7k 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.
  • Г
    Геннадий Гайдукевич
    last edited by Геннадий Гайдукевич Jul 5, 2022, 7:13 AM Jul 5, 2022, 7:12 AM

    Hello!

    I have a list of links that I need to trim. Basically I need to remove everything starting with ?__cft

    I googled how to do that but it doesn’t seem to work.

    2022-07-05_9-57-09.jpg

    N 1 Reply Last reply Jul 5, 2022, 7:23 AM Reply Quote 0
    • N
      Neil Schipper @Геннадий Гайдукевич
      last edited by Jul 5, 2022, 7:23 AM

      @Геннадий-Гайдукевич

      ? is a special character and so needs to be “escaped” so the regex machine takes it literally (treats it as a simple character).

      Start your expression with \? instead.

      1 Reply Last reply Reply Quote 3
      • G
        guy038
        last edited by guy038 Jul 5, 2022, 7:42 AM Jul 5, 2022, 7:40 AM

        Hello, @Геннадий-Гайдукевич, @neil-shcipper and All,

        In the Find What: field of your picture, we see that searched string :

        ?__cft-.*

        So, from your shown text, I suppose that the correct regex syntax is :

        SEARCH \?__cft__.*

        REPLACE Leave EMPTY

        Best Regards

        guy038

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