Community
    • Login

    Regular replace does not work with multiple single quotes

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 455 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.
    • mscislawinM Offline
      mscislawin
      last edited by PeterJones

      I had to make some fast inserts for another table so i prepared them as outputs of sql query in pgadmin.
      pgAdmin adds single quote when copying data from the cell but it also adds one single quote when there was one already inside cell value so i get following when copying from pgAdmin gui

      'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
      

      Now when i copy that and paste it to n++ and do the normal find plus normal replace and want to replace all '' with ' it only replaces first occurence of the ''
      Is this a bug?

      -—
      moderator note: added ``` plaintext (code) tags around the example text

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @mscislawin
        last edited by

        @mscislawin said in Regular replace does not work with multiple single quotes:

        when i copy that and paste it to n++ and do the normal find plus normal replace and want to replace all ‘’ with ’ it only replaces first occurence of the ‘’

        Did you click Replace or did you click Replace All after setting up Find what: '' and Replace With: ' ?

        Because
        76b51f95-e538-48cd-9e09-46b913b4812e-image.png
        =>
        f7fde8af-b620-4656-b355-c851309e7048-image.png

        'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
        'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
        'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
        'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
        'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'
        

        =>

        'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'
        'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'
        'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'
        'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'
        'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'
        

        It does exactly what I’d expect

        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