Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Regular replace does not work with multiple single quotes

    Help wanted · · · – – – · · ·
    2
    2
    77
    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.
    • mscislawin
      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

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        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
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors