Community
    • Login

    Search and replace with wildcards

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 5.8k 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.
    • Corné HaastC Offline
      Corné Haast
      last edited by

      I have read the wiki, but it’s so overwhelming when I see all the possibiities. For you maybe a simple solution:
      I want to remove strings of characters which all start with “sdval=” , but the next characters are all different, and the number of characters is not always the same.
      e.g. : sdval=“28076” or sdval=“2.17” both must be removed with the same search and replace action.

      Thank you for your help

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Corné Haast
        last edited by

        @Corné-Haast

        are the quotes part of the real text, meaning
        is it sdval=“28076” or sdval=28076
        Comes something after this which is always the same? Maybe always a space?
        Must only the digits be replaced or sdval as well?

        Cheers
        Claudia

        Corné HaastC 1 Reply Last reply Reply Quote 0
        • Corné HaastC Offline
          Corné Haast @Claudia Frank
          last edited by

          @Claudia-Frank Yes “” uncluded, and yes, there is always a space after it.

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank @Corné Haast
            last edited by Claudia Frank

            @Corné-Haast

            open find/replace dialog and check regular expressions. (bottom left)
            For find use:

             sdval=".+?"
            

            and for replace your value.

            The regex looks for sdval=" literally followed by any char until the next double quote appears.

            . = any char
            + = at least one char expected
            ? = non-greedy
            

            More infos how npps regex engine works can be found here.

            Cheers
            Claudia

            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